Changeset 33984
- Timestamp:
- 09/10/2015 01:20:58 AM (11 years ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 5 edited
-
class-wp-filesystem-base.php (modified) (31 diffs)
-
class-wp-filesystem-direct.php (modified) (27 diffs)
-
class-wp-filesystem-ftpext.php (modified) (27 diffs)
-
class-wp-filesystem-ftpsockets.php (modified) (26 diffs)
-
class-wp-filesystem-ssh2.php (modified) (30 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-filesystem-base.php
r32962 r33984 25 25 * Cached list of local filepaths to mapped remote filepaths. 26 26 * 27 * @access public 27 28 * @since 2.7.0 28 29 * @var array … … 39 40 public $method = ''; 40 41 42 /** 43 * @access public 44 */ 41 45 public $errors = null; 42 46 47 /** 48 * @access public 49 */ 43 50 public $options = array(); 44 51 … … 231 238 * Expects Windows sanitized path. 232 239 * 240 * @access public 233 241 * @since 2.7.0 234 242 * … … 355 363 * Gets the permissions of the specified file or filepath in their octal format 356 364 * 365 * @access public 357 366 * @since 2.5.0 358 367 * @param string $file … … 402 411 * Determine if the string provided contains binary characters. 403 412 * 413 * @access public 404 414 * @since 2.7.0 405 415 * … … 416 426 * Default behavior is to do nothing, override this in your subclass, if desired. 417 427 * 428 * @access public 418 429 * @since 2.5.0 419 430 * … … 430 441 * Connect filesystem. 431 442 * 432 * @since 2.5.0 433 * @abstract 443 * @access public 444 * @since 2.5.0 445 * @abstract 446 * 434 447 * @return bool True on success or false on failure (always true for WP_Filesystem_Direct). 435 448 */ … … 441 454 * Read entire file into a string. 442 455 * 443 * @since 2.5.0 444 * @abstract 456 * @access public 457 * @since 2.5.0 458 * @abstract 459 * 445 460 * @param string $file Name of the file to read. 446 461 * @return mixed|bool Returns the read data or false on failure. … … 453 468 * Read entire file into an array. 454 469 * 455 * @since 2.5.0 456 * @abstract 470 * @access public 471 * @since 2.5.0 472 * @abstract 473 * 457 474 * @param string $file Path to the file. 458 475 * @return array|bool the file contents in an array or false on failure. … … 465 482 * Write a string to a file. 466 483 * 467 * @since 2.5.0 468 * @abstract 484 * @access public 485 * @since 2.5.0 486 * @abstract 487 * 469 488 * @param string $file Remote path to the file where to write the data. 470 489 * @param string $contents The data to write. … … 479 498 * Get the current working directory. 480 499 * 481 * @since 2.5.0 482 * @abstract 500 * @access public 501 * @since 2.5.0 502 * @abstract 503 * 483 504 * @return string|bool The current working directory on success, or false on failure. 484 505 */ … … 490 511 * Change current directory. 491 512 * 492 * @since 2.5.0 493 * @abstract 513 * @access public 514 * @since 2.5.0 515 * @abstract 516 * 494 517 * @param string $dir The new current directory. 495 518 * @return bool|string … … 502 525 * Change the file group. 503 526 * 504 * @since 2.5.0 505 * @abstract 527 * @access public 528 * @since 2.5.0 529 * @abstract 530 * 506 531 * @param string $file Path to the file. 507 532 * @param mixed $group A group name or number. … … 516 541 * Change filesystem permissions. 517 542 * 518 * @since 2.5.0 519 * @abstract 543 * @access public 544 * @since 2.5.0 545 * @abstract 546 * 520 547 * @param string $file Path to the file. 521 548 * @param int $mode Optional. The permissions as octal number, usually 0644 for files, 0755 for dirs. … … 530 557 * Get the file owner. 531 558 * 532 * @since 2.5.0 533 * @abstract 559 * @access public 560 * @since 2.5.0 561 * @abstract 562 * 534 563 * @param string $file Path to the file. 535 564 * @return string|bool Username of the user or false on error. … … 542 571 * Get the file's group. 543 572 * 544 * @since 2.5.0 545 * @abstract 573 * @access public 574 * @since 2.5.0 575 * @abstract 576 * 546 577 * @param string $file Path to the file. 547 578 * @return string|bool The group or false on error. … … 554 585 * Copy a file. 555 586 * 556 * @since 2.5.0 557 * @abstract 587 * @access public 588 * @since 2.5.0 589 * @abstract 590 * 558 591 * @param string $source Path to the source file. 559 592 * @param string $destination Path to the destination file. … … 571 604 * Move a file. 572 605 * 573 * @since 2.5.0 574 * @abstract 606 * @access public 607 * @since 2.5.0 608 * @abstract 609 * 575 610 * @param string $source Path to the source file. 576 611 * @param string $destination Path to the destination file. … … 586 621 * Delete a file or directory. 587 622 * 588 * @since 2.5.0 589 * @abstract 623 * @access public 624 * @since 2.5.0 625 * @abstract 626 * 590 627 * @param string $file Path to the file. 591 628 * @param bool $recursive Optional. If set True changes file group recursively. Defaults to False. … … 602 639 * Check if a file or directory exists. 603 640 * 604 * @since 2.5.0 605 * @abstract 641 * @access public 642 * @since 2.5.0 643 * @abstract 644 * 606 645 * @param string $file Path to file/directory. 607 646 * @return bool Whether $file exists or not. … … 614 653 * Check if resource is a file. 615 654 * 616 * @since 2.5.0 617 * @abstract 655 * @access public 656 * @since 2.5.0 657 * @abstract 658 * 618 659 * @param string $file File path. 619 660 * @return bool Whether $file is a file. … … 626 667 * Check if resource is a directory. 627 668 * 628 * @since 2.5.0 629 * @abstract 669 * @access public 670 * @since 2.5.0 671 * @abstract 672 * 630 673 * @param string $path Directory path. 631 674 * @return bool Whether $path is a directory. … … 638 681 * Check if a file is readable. 639 682 * 640 * @since 2.5.0 641 * @abstract 683 * @access public 684 * @since 2.5.0 685 * @abstract 686 * 642 687 * @param string $file Path to file. 643 688 * @return bool Whether $file is readable. … … 650 695 * Check if a file or directory is writable. 651 696 * 652 * @since 2.5.0 653 * @abstract 697 * @access public 698 * @since 2.5.0 699 * @abstract 700 * 654 701 * @return bool Whether $file is writable. 655 702 */ … … 661 708 * Gets the file's last access time. 662 709 * 663 * @since 2.5.0 664 * @abstract 710 * @access public 711 * @since 2.5.0 712 * @abstract 713 * 665 714 * @param string $file Path to file. 666 715 * @return int|bool Unix timestamp representing last access time. … … 673 722 * Gets the file modification time. 674 723 * 675 * @since 2.5.0 676 * @abstract 724 * @access public 725 * @since 2.5.0 726 * @abstract 727 * 677 728 * @param string $file Path to file. 678 729 * @return int|bool Unix timestamp representing modification time. … … 685 736 * Gets the file size (in bytes). 686 737 * 687 * @since 2.5.0 688 * @abstract 738 * @access public 739 * @since 2.5.0 740 * @abstract 741 * 689 742 * @param string $file Path to file. 690 743 * @return int|bool Size of the file in bytes. … … 699 752 * Note: If $file doesn't exist, it will be created. 700 753 * 701 * @since 2.5.0 702 * @abstract 754 * @access public 755 * @since 2.5.0 756 * @abstract 757 * 703 758 * @param string $file Path to file. 704 759 * @param int $time Optional. Modified time to set for file. … … 715 770 * Create a directory. 716 771 * 717 * @since 2.5.0 718 * @abstract 772 * @access public 773 * @since 2.5.0 774 * @abstract 775 * 719 776 * @param string $path Path for new directory. 720 777 * @param mixed $chmod Optional. The permissions as octal number, (or False to skip chmod) … … 733 790 * Delete a directory. 734 791 * 735 * @since 2.5.0 736 * @abstract 792 * @access public 793 * @since 2.5.0 794 * @abstract 795 * 737 796 * @param string $path Path to directory. 738 797 * @param bool $recursive Optional. Whether to recursively remove files/directories. … … 747 806 * Get details for files in a directory or a specific file. 748 807 * 808 * @access public 749 809 * @since 2.5.0 750 810 * @abstract -
trunk/src/wp-admin/includes/class-wp-filesystem-direct.php
r30978 r33984 20 20 * constructor 21 21 * 22 * @access public 23 * 22 24 * @param mixed $arg ignored argument 23 25 */ … … 30 32 * Reads entire file into a string 31 33 * 34 * @access public 35 * 32 36 * @param string $file Name of the file to read. 33 37 * @return string|bool The function returns the read data or false on failure. … … 40 44 * Reads entire file into an array 41 45 * 46 * @access public 47 * 42 48 * @param string $file Path to the file. 43 49 * @return array|bool the file contents in an array or false on failure. … … 49 55 /** 50 56 * Write a string to a file 57 * 58 * @access public 51 59 * 52 60 * @param string $file Remote path to the file where to write the data. … … 82 90 * Gets the current working directory 83 91 * 92 * @access public 93 * 84 94 * @return string|bool the current working directory on success, or false on failure. 85 95 */ … … 91 101 * Change directory 92 102 * 103 * @access public 104 * 93 105 * @param string $dir The new current directory. 94 106 * @return bool Returns true on success or false on failure. … … 100 112 /** 101 113 * Changes file group 114 * 115 * @access public 102 116 * 103 117 * @param string $file Path to the file. … … 125 139 * Changes filesystem permissions 126 140 * 141 * @access public 142 * 127 143 * @param string $file Path to the file. 128 144 * @param int $mode Optional. The permissions as octal number, usually 0644 for files, … … 154 170 /** 155 171 * Changes file owner 172 * 173 * @access public 156 174 * 157 175 * @param string $file Path to the file. … … 179 197 * Gets file owner 180 198 * 199 * @access public 200 * 181 201 * @param string $file Path to the file. 182 202 * @return string|bool Username of the user or false on error. … … 197 217 * FIXME does not handle errors in fileperms() 198 218 * 219 * @access public 220 * 199 221 * @param string $file Path to the file. 200 222 * @return string Mode of the file (last 3 digits). … … 205 227 206 228 /** 229 * @access public 230 * 207 231 * @param string $file 208 232 * @return string|false … … 219 243 220 244 /** 245 * @access public 246 * 221 247 * @param string $source 222 248 * @param string $destination … … 236 262 237 263 /** 264 * @access public 265 * 238 266 * @param string $source 239 267 * @param string $destination … … 258 286 259 287 /** 288 * @access public 289 * 260 290 * @param string $file 261 291 * @param bool $recursive … … 291 321 } 292 322 /** 323 * @access public 324 * 293 325 * @param string $file 294 326 * @return bool … … 298 330 } 299 331 /** 332 * @access public 333 * 300 334 * @param string $file 301 335 * @return bool … … 305 339 } 306 340 /** 341 * @access public 342 * 307 343 * @param string $path 308 344 * @return bool … … 313 349 314 350 /** 351 * @access public 352 * 315 353 * @param string $file 316 354 * @return bool … … 321 359 322 360 /** 361 * @access public 362 * 323 363 * @param string $file 324 364 * @return bool … … 329 369 330 370 /** 371 * @access public 372 * 331 373 * @param string $file 332 374 * @return int … … 337 379 338 380 /** 381 * @access public 382 * 339 383 * @param string $file 340 384 * @return int … … 345 389 346 390 /** 391 * @access public 392 * 347 393 * @param string $file 348 394 * @return int … … 353 399 354 400 /** 401 * @access public 402 * 355 403 * @param string $file 356 404 * @param int $time … … 367 415 368 416 /** 417 * @access public 418 * 369 419 * @param string $path 370 420 * @param mixed $chmod … … 393 443 394 444 /** 445 * @access public 446 * 395 447 * @param string $path 396 448 * @param bool $recursive … … 402 454 403 455 /** 456 * @access public 457 * 404 458 * @param string $path 405 459 * @param bool $include_hidden -
trunk/src/wp-admin/includes/class-wp-filesystem-ftpext.php
r33648 r33984 19 19 20 20 /** 21 * @access public 21 22 * 22 23 * @param array $opt … … 64 65 65 66 /** 67 * @access public 66 68 * 67 69 * @return bool … … 92 94 93 95 /** 96 * @access public 97 * 94 98 * @param string $file 95 99 * @return false|string … … 117 121 118 122 /** 123 * @access public 124 * 119 125 * @param string $file 120 126 * @return array … … 125 131 126 132 /** 133 * @access public 134 * 127 135 * @param string $file 128 136 * @param string $contents … … 162 170 163 171 /** 172 * @access public 173 * 164 174 * @return string 165 175 */ … … 172 182 173 183 /** 184 * @access public 185 * 174 186 * @param string $dir 175 187 * @return bool … … 180 192 181 193 /** 194 * @access public 195 * 182 196 * @param string $file 183 197 * @param int $mode … … 209 223 210 224 /** 225 * @access public 226 * 211 227 * @param string $file 212 228 * @return string … … 217 233 } 218 234 /** 235 * @access public 236 * 219 237 * @param string $file 220 238 * @return string … … 224 242 return $dir[$file]['permsn']; 225 243 } 226 /** 244 245 /** 246 * @access public 247 * 227 248 * @param string $file 228 249 * @return string … … 234 255 235 256 /** 257 * @access public 236 258 * 237 259 * @param string $source … … 249 271 return $this->put_contents($destination, $content, $mode); 250 272 } 251 /** 273 274 /** 275 * @access public 276 * 252 277 * @param string $source 253 278 * @param string $destination … … 258 283 return ftp_rename($this->link, $source, $destination); 259 284 } 260 /** 285 286 /** 287 * @access public 288 * 261 289 * @param string $file 262 290 * @param bool $recursive … … 278 306 return @ftp_rmdir($this->link, $file); 279 307 } 280 /** 308 309 /** 310 * @access public 311 * 281 312 * @param string $file 282 313 * @return bool … … 291 322 return !empty($list); //empty list = no file, so invert. 292 323 } 293 /** 324 325 /** 326 * @access public 327 * 294 328 * @param string $file 295 329 * @return bool … … 298 332 return $this->exists($file) && !$this->is_dir($file); 299 333 } 300 /** 334 335 /** 336 * @access public 337 * 301 338 * @param string $path 302 339 * @return bool … … 313 350 314 351 /** 352 * @access public 353 * 315 354 * @param string $file 316 355 * @return bool … … 319 358 return true; 320 359 } 321 /** 360 361 /** 362 * @access public 363 * 322 364 * @param string $file 323 365 * @return bool … … 326 368 return true; 327 369 } 328 /** 370 371 /** 372 * @access public 373 * 329 374 * @param string $file 330 375 * @return bool … … 333 378 return false; 334 379 } 335 /** 380 381 /** 382 * @access public 383 * 336 384 * @param string $file 337 385 * @return int … … 340 388 return ftp_mdtm($this->link, $file); 341 389 } 342 /** 390 391 /** 392 * @access public 393 * 343 394 * @param string $file 344 395 * @return int … … 347 398 return ftp_size($this->link, $file); 348 399 } 349 /** 400 401 /** 402 * @access public 403 * 350 404 * @param string $file 351 405 * @return bool … … 356 410 357 411 /** 412 * @access public 413 * 358 414 * @param string $path 359 415 * @param mixed $chmod … … 374 430 375 431 /** 432 * @access public 433 * 376 434 * @param string $path 377 435 * @param bool $recursive … … 383 441 384 442 /** 443 * @access public 444 * 385 445 * @staticvar bool $is_windows 386 446 * @param string $line … … 462 522 463 523 /** 524 * @access public 525 * 464 526 * @param string $path 465 527 * @param bool $include_hidden -
trunk/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php
r33648 r33984 17 17 class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { 18 18 /** 19 * @access public 19 20 * @var ftp 20 21 */ … … 22 23 23 24 /** 25 * @access public 24 26 * 25 27 * @param array $opt … … 58 60 59 61 /** 62 * @access public 60 63 * 61 64 * @return bool … … 89 92 90 93 /** 94 * @access public 95 * 91 96 * @param string $file 92 97 * @return false|string … … 124 129 return $contents; 125 130 } 126 /** 131 132 /** 133 * @access public 134 * 127 135 * @param string $file 128 136 * @return array … … 133 141 134 142 /** 143 * @access public 144 * 135 145 * @param string $file 136 146 * @param string $contents … … 173 183 174 184 /** 185 * @access public 175 186 * 176 187 * @return string … … 184 195 185 196 /** 197 * @access public 186 198 * 187 199 * @param string $file … … 193 205 194 206 /** 207 * @access public 208 * 195 209 * @param string $file 196 210 * @param int|bool $mode … … 220 234 221 235 /** 236 * @access public 237 * 222 238 * @param string $file 223 239 * @return string … … 227 243 return $dir[$file]['owner']; 228 244 } 229 /** 245 246 /** 247 * @access public 248 * 230 249 * @param string $file 231 250 * @return string … … 235 254 return $dir[$file]['permsn']; 236 255 } 237 /** 256 257 /** 258 * @access public 259 * 238 260 * @param string $file 239 261 * @return string … … 243 265 return $dir[$file]['group']; 244 266 } 245 /** 267 268 /** 269 * @access public 270 * 246 271 * @param string $source 247 272 * @param string $destination … … 260 285 return $this->put_contents($destination, $content, $mode); 261 286 } 262 /** 287 288 /** 289 * @access public 290 * 263 291 * @param string $source 264 292 * @param string $destination … … 269 297 return $this->ftp->rename($source, $destination); 270 298 } 271 /** 299 300 /** 301 * @access public 302 * 272 303 * @param string $file 273 304 * @param bool $recursive … … 287 318 288 319 /** 320 * @access public 321 * 289 322 * @param string $file 290 323 * @return bool … … 302 335 303 336 /** 337 * @access public 338 * 304 339 * @param string $file 305 340 * @return bool … … 314 349 315 350 /** 351 * @access public 352 * 316 353 * @param string $path 317 354 * @return bool … … 327 364 328 365 /** 366 * @access public 367 * 329 368 * @param string $file 330 369 * @return bool … … 335 374 336 375 /** 376 * @access public 377 * 337 378 * @param string $file 338 379 * @return bool … … 343 384 344 385 /** 386 * @access public 387 * 345 388 * @param string $file 346 389 * @return bool … … 351 394 352 395 /** 396 * @access public 397 * 353 398 * @param string $file 354 399 * @return int … … 365 410 return $this->ftp->filesize($file); 366 411 } 367 /** 412 413 /** 414 * @access public 415 * 368 416 * @param string $file 369 417 * @param int $time … … 376 424 377 425 /** 426 * @access public 427 * 378 428 * @param string $path 379 429 * @param mixed $chmod … … 396 446 397 447 /** 448 * @access public 449 * 398 450 * @param string $path 399 451 * @param bool $recursive … … 404 456 405 457 /** 458 * @access public 459 * 406 460 * @param string $path 407 461 * @param bool $include_hidden -
trunk/src/wp-admin/includes/class-wp-filesystem-ssh2.php
r33688 r33984 36 36 class WP_Filesystem_SSH2 extends WP_Filesystem_Base { 37 37 38 /** 39 * @access public 40 */ 38 41 public $link = false; 39 /** 42 43 /** 44 * @access public 40 45 * @var resource 41 46 */ … … 44 49 45 50 /** 51 * @access public 46 52 * 47 53 * @param array $opt … … 97 103 98 104 /** 105 * @access public 99 106 * 100 107 * @return bool … … 130 137 131 138 /** 139 * @access public 140 * 132 141 * @param string $command 133 142 * @param bool $returnbool … … 155 164 156 165 /** 166 * @access public 167 * 157 168 * @param string $file 158 169 * @return string|false … … 164 175 165 176 /** 177 * @access public 178 * 166 179 * @param string $file 167 180 * @return array … … 173 186 174 187 /** 188 * @access public 189 * 175 190 * @param string $file 176 191 * @param string $contents … … 190 205 191 206 /** 207 * @access public 192 208 * 193 209 * @return bool … … 202 218 203 219 /** 220 * @access public 221 * 204 222 * @param string $dir 205 223 * @return bool|string … … 210 228 211 229 /** 230 * @access public 231 * 212 232 * @param string $file 213 233 * @param string $group … … 225 245 226 246 /** 247 * @access public 248 * 227 249 * @param string $file 228 250 * @param int $mode … … 251 273 * Change the ownership of a file / folder. 252 274 * 253 * @ since Unknown275 * @access public 254 276 * 255 277 * @param string $file Path to the file. … … 267 289 268 290 /** 291 * @access public 292 * 269 293 * @param string $file 270 294 * @return string|false … … 279 303 return $ownerarray['name']; 280 304 } 281 /** 305 306 /** 307 * @access public 308 * 282 309 * @param string $file 283 310 * @return string … … 288 315 289 316 /** 317 * @access public 318 * 290 319 * @param string $file 291 320 * @return string|false … … 302 331 303 332 /** 333 * @access public 334 * 304 335 * @param string $source 305 336 * @param string $destination … … 318 349 319 350 /** 351 * @access public 352 * 320 353 * @param string $source 321 354 * @param string $destination … … 328 361 329 362 /** 363 * @access public 364 * 330 365 * @param string $file 331 366 * @param bool $recursive … … 348 383 349 384 /** 385 * @access public 386 * 350 387 * @param string $file 351 388 * @return bool … … 355 392 return file_exists('ssh2.sftp://' . $this->sftp_link . '/' . $file); 356 393 } 357 /** 394 395 /** 396 * @access public 397 * 358 398 * @param string $file 359 399 * @return bool … … 363 403 return is_file('ssh2.sftp://' . $this->sftp_link . '/' . $file); 364 404 } 365 /** 405 406 /** 407 * @access public 408 * 366 409 * @param string $path 367 410 * @return bool … … 371 414 return is_dir('ssh2.sftp://' . $this->sftp_link . '/' . $path); 372 415 } 373 /** 416 417 /** 418 * @access public 419 * 374 420 * @param string $file 375 421 * @return bool … … 379 425 return is_readable('ssh2.sftp://' . $this->sftp_link . '/' . $file); 380 426 } 381 /** 427 428 /** 429 * @access public 430 * 382 431 * @param string $file 383 432 * @return bool … … 387 436 return true; 388 437 } 389 /** 438 439 /** 440 * @access public 441 * 390 442 * @param string $file 391 443 * @return int … … 397 449 398 450 /** 451 * @access public 452 * 399 453 * @param string $file 400 454 * @return int … … 406 460 407 461 /** 462 * @access public 463 * 408 464 * @param string $file 409 465 * @return int … … 415 471 416 472 /** 473 * @access public 474 * 417 475 * @param string $file 418 476 * @param int $time … … 424 482 425 483 /** 484 * @access public 485 * 426 486 * @param string $path 427 487 * @param mixed $chmod … … 447 507 448 508 /** 509 * @access public 510 * 449 511 * @param string $path 450 512 * @param bool $recursive … … 456 518 457 519 /** 520 * @access public 521 * 458 522 * @param string $path 459 523 * @param bool $include_hidden
Note: See TracChangeset
for help on using the changeset viewer.