Changeset 28487
- Timestamp:
- 05/19/2014 12:05:06 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-filesystem-base.php
r25560 r28487 20 20 * @var bool 21 21 */ 22 var$verbose = false;22 public $verbose = false; 23 23 24 24 /** … … 29 29 * @var array 30 30 */ 31 var$cache = array();31 private $cache = array(); 32 32 33 33 /** … … 38 38 * @var string 39 39 */ 40 var$method = '';40 public $method = ''; 41 41 42 42 /** 43 43 * Constructor (empty). 44 44 */ 45 function __construct() {} 45 public function __construct() {} 46 47 /** 48 * Make private properties readable for backwards compatibility 49 * 50 * @since 4.0.0 51 * @param string $name 52 * @return mixed 53 */ 54 public function __get( $name ) { 55 return $this->$name; 56 } 46 57 47 58 /** … … 53 64 * @return string The location of the remote path. 54 65 */ 55 function abspath() {66 public function abspath() { 56 67 $folder = $this->find_folder(ABSPATH); 57 68 // Perhaps the FTP folder is rooted at the WordPress install, Check for wp-includes folder in root, Could have some false positives, but rare. … … 69 80 * @return string The location of the remote path. 70 81 */ 71 function wp_content_dir() {82 public function wp_content_dir() { 72 83 return $this->find_folder(WP_CONTENT_DIR); 73 84 } … … 81 92 * @return string The location of the remote path. 82 93 */ 83 function wp_plugins_dir() {94 public function wp_plugins_dir() { 84 95 return $this->find_folder(WP_PLUGIN_DIR); 85 96 } … … 94 105 * @return string The location of the remote path. 95 106 */ 96 function wp_themes_dir( $theme = false ) {107 public function wp_themes_dir( $theme = false ) { 97 108 $theme_root = get_theme_root( $theme ); 98 109 … … 112 123 * @return string The location of the remote path. 113 124 */ 114 function wp_lang_dir() {125 public function wp_lang_dir() { 115 126 return $this->find_folder(WP_LANG_DIR); 116 127 } … … 133 144 * @return string The location of the remote path. 134 145 */ 135 function find_base_dir( $base = '.', $echo = false ) {146 public function find_base_dir( $base = '.', $echo = false ) { 136 147 _deprecated_function(__FUNCTION__, '2.7', 'WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir()' ); 137 148 $this->verbose = $echo; … … 155 166 * @return string The location of the remote path. 156 167 */ 157 function get_base_dir( $base = '.', $echo = false ) {168 public function get_base_dir( $base = '.', $echo = false ) { 158 169 _deprecated_function(__FUNCTION__, '2.7', 'WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir()' ); 159 170 $this->verbose = $echo; … … 173 184 * @return string The location of the remote path. 174 185 */ 175 function find_folder( $folder ) {186 public function find_folder( $folder ) { 176 187 177 188 if ( isset( $this->cache[ $folder ] ) ) … … 242 253 * @return string The location of the remote path. 243 254 */ 244 function search_for_folder( $folder, $base = '.', $loop = false ) {255 public function search_for_folder( $folder, $base = '.', $loop = false ) { 245 256 if ( empty( $base ) || '.' == $base ) 246 257 $base = trailingslashit($this->cwd()); … … 309 320 * @return string The *nix-style representation of permissions. 310 321 */ 311 function gethchmod( $file ){322 public function gethchmod( $file ){ 312 323 $perms = $this->getchmod($file); 313 324 if (($perms & 0xC000) == 0xC000) // Socket … … 365 376 * @return int octal representation 366 377 */ 367 function getnumchmodfromh( $mode ) {378 public function getnumchmodfromh( $mode ) { 368 379 $realmode = ''; 369 380 $legal = array('', 'w', 'r', 'x', '-'); … … 394 405 * @return bool true if string is binary, false otherwise. 395 406 */ 396 function is_binary( $text ) {407 public function is_binary( $text ) { 397 408 return (bool) preg_match( '|[^\x20-\x7E]|', $text ); // chr(32)..chr(127) 398 409 } … … 410 421 * @return bool Returns true on success or false on failure. 411 422 */ 412 function chown( $file, $owner, $recursive = false ) {423 public function chown( $file, $owner, $recursive = false ) { 413 424 return false; 414 425 } … … 421 432 * @return bool True on success or false on failure (always true for WP_Filesystem_Direct). 422 433 */ 423 function connect() {434 public function connect() { 424 435 return true; 425 436 } … … 433 444 * @return string|bool Returns the read data or false on failure. 434 445 */ 435 function get_contents( $file ) {446 public function get_contents( $file ) { 436 447 return false; 437 448 } … … 445 456 * @return array|bool the file contents in an array or false on failure. 446 457 */ 447 function get_contents_array( $file ) {458 public function get_contents_array( $file ) { 448 459 return false; 449 460 } … … 459 470 * @return bool False on failure. 460 471 */ 461 function put_contents( $file, $contents, $mode = false ) {472 public function put_contents( $file, $contents, $mode = false ) { 462 473 return false; 463 474 } … … 470 481 * @return string|bool The current working directory on success, or false on failure. 471 482 */ 472 function cwd() {483 public function cwd() { 473 484 return false; 474 485 } … … 482 493 * @return bool Returns true on success or false on failure. 483 494 */ 484 function chdir( $dir ) {495 public function chdir( $dir ) { 485 496 return false; 486 497 } … … 496 507 * @return bool Returns true on success or false on failure. 497 508 */ 498 function chgrp( $file, $group, $recursive = false ) {509 public function chgrp( $file, $group, $recursive = false ) { 499 510 return false; 500 511 } … … 510 521 * @return bool Returns true on success or false on failure. 511 522 */ 512 function chmod( $file, $mode = false, $recursive = false ) {523 public function chmod( $file, $mode = false, $recursive = false ) { 513 524 return false; 514 525 } … … 522 533 * @return string|bool Username of the user or false on error. 523 534 */ 524 function owner( $file ) {535 public function owner( $file ) { 525 536 return false; 526 537 } … … 534 545 * @return string|bool The group or false on error. 535 546 */ 536 function group( $file ) {547 public function group( $file ) { 537 548 return false; 538 549 } … … 551 562 * @return bool True if file copied successfully, False otherwise. 552 563 */ 553 function copy( $source, $destination, $overwrite = false, $mode = false ) {564 public function copy( $source, $destination, $overwrite = false, $mode = false ) { 554 565 return false; 555 566 } … … 566 577 * @return bool True if file copied successfully, False otherwise. 567 578 */ 568 function move( $source, $destination, $overwrite = false ) {579 public function move( $source, $destination, $overwrite = false ) { 569 580 return false; 570 581 } … … 582 593 * @return bool True if the file or directory was deleted, false on failure. 583 594 */ 584 function delete( $file, $recursive = false, $type = false ) {595 public function delete( $file, $recursive = false, $type = false ) { 585 596 return false; 586 597 } … … 594 605 * @return bool Whether $file exists or not. 595 606 */ 596 function exists( $file ) {607 public function exists( $file ) { 597 608 return false; 598 609 } … … 606 617 * @return bool Whether $file is a file. 607 618 */ 608 function is_file( $file ) {619 public function is_file( $file ) { 609 620 return false; 610 621 } … … 618 629 * @return bool Whether $path is a directory. 619 630 */ 620 function is_dir( $path ) {631 public function is_dir( $path ) { 621 632 return false; 622 633 } … … 630 641 * @return bool Whether $file is readable. 631 642 */ 632 function is_readable( $file ) {643 public function is_readable( $file ) { 633 644 return false; 634 645 } … … 642 653 * @return bool Whether $file is writable. 643 654 */ 644 function is_writable( $file ) {655 public function is_writable( $file ) { 645 656 return false; 646 657 } … … 654 665 * @return int Unix timestamp representing last access time. 655 666 */ 656 function atime( $file ) {667 public function atime( $file ) { 657 668 return false; 658 669 } … … 666 677 * @return int Unix timestamp representing modification time. 667 678 */ 668 function mtime( $file ) {679 public function mtime( $file ) { 669 680 return false; 670 681 } … … 678 689 * @return int Size of the file in bytes. 679 690 */ 680 function size( $file ) {691 public function size( $file ) { 681 692 return false; 682 693 } … … 696 707 * @return bool Whether operation was successful or not. 697 708 */ 698 function touch( $file, $time = 0, $atime = 0 ) {709 public function touch( $file, $time = 0, $atime = 0 ) { 699 710 return false; 700 711 } … … 714 725 * @return bool False if directory cannot be created, true otherwise. 715 726 */ 716 function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) {727 public function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) { 717 728 return false; 718 729 } … … 728 739 * @return bool Whether directory is deleted successfully or not. 729 740 */ 730 function rmdir( $path, $recursive = false ) {741 public function rmdir( $path, $recursive = false ) { 731 742 return false; 732 743 } … … 757 768 * } 758 769 */ 759 function dirlist( $path, $include_hidden = true, $recursive = false ) {770 public function dirlist( $path, $include_hidden = true, $recursive = false ) { 760 771 return false; 761 772 }
Note: See TracChangeset
for help on using the changeset viewer.