Make WordPress Core


Ignore:
Timestamp:
05/19/2014 12:08:38 AM (13 years ago)
Author:
wonderboymusic
Message:

Add access modifier (public) to methods in WP_Filesystem_Direct.

See #27881, #22234.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-filesystem-direct.php

    r27566 r28488  
    2222         * @param mixed $arg ignored argument
    2323         */
    24         function __construct($arg) {
     24        public function __construct($arg) {
    2525                $this->method = 'direct';
    2626                $this->errors = new WP_Error();
    … …  
    3333         * @return string|bool The function returns the read data or false on failure.
    3434         */
    35         function get_contents($file) {
     35        public function get_contents($file) {
    3636                return @file_get_contents($file);
    3737        }
    … …  
    4343         * @return array|bool the file contents in an array or false on failure.
    4444         */
    45         function get_contents_array($file) {
     45        public function get_contents_array($file) {
    4646                return @file($file);
    4747        }
    … …  
    5555         * @return bool False upon failure.
    5656         */
    57         function put_contents( $file, $contents, $mode = false ) {
     57        public function put_contents( $file, $contents, $mode = false ) {
    5858                $fp = @fopen( $file, 'wb' );
    5959                if ( ! $fp )
    … …  
    8383         * @return string|bool the current working directory on success, or false on failure.
    8484         */
    85         function cwd() {
     85        public function cwd() {
    8686                return @getcwd();
    8787        }
    … …  
    9393         * @return bool Returns true on success or false on failure.
    9494         */
    95         function chdir($dir) {
     95        public function chdir($dir) {
    9696                return @chdir($dir);
    9797        }
    … …  
    105105         * @return bool Returns true on success or false on failure.
    106106         */
    107         function chgrp($file, $group, $recursive = false) {
     107        public function chgrp($file, $group, $recursive = false) {
    108108                if ( ! $this->exists($file) )
    109109                        return false;
    … …  
    129129         * @return bool Returns true on success or false on failure.
    130130         */
    131         function chmod($file, $mode = false, $recursive = false) {
     131        public function chmod($file, $mode = false, $recursive = false) {
    132132                if ( ! $mode ) {
    133133                        if ( $this->is_file($file) )
    … …  
    158158         * @return bool Returns true on success or false on failure.
    159159         */
    160         function chown($file, $owner, $recursive = false) {
     160        public function chown($file, $owner, $recursive = false) {
    161161                if ( ! $this->exists($file) )
    162162                        return false;
    … …  
    179179         * @return string|bool Username of the user or false on error.
    180180         */
    181         function owner($file) {
     181        public function owner($file) {
    182182                $owneruid = @fileowner($file);
    183183                if ( ! $owneruid )
    … …  
    197197         * @return string Mode of the file (last 3 digits).
    198198         */
    199         function getchmod($file) {
     199        public function getchmod($file) {
    200200                return substr( decoct( @fileperms( $file ) ), -3 );
    201201        }
    202202
    203         function group($file) {
     203        public function group($file) {
    204204                $gid = @filegroup($file);
    205205                if ( ! $gid )
    … …  
    211211        }
    212212
    213         function copy($source, $destination, $overwrite = false, $mode = false) {
     213        public function copy($source, $destination, $overwrite = false, $mode = false) {
    214214                if ( ! $overwrite && $this->exists($destination) )
    215215                        return false;
    … …  
    221221        }
    222222
    223         function move($source, $destination, $overwrite = false) {
     223        public function move($source, $destination, $overwrite = false) {
    224224                if ( ! $overwrite && $this->exists($destination) )
    225225                        return false;
    … …  
    237237        }
    238238
    239         function delete($file, $recursive = false, $type = false) {
     239        public function delete($file, $recursive = false, $type = false) {
    240240                if ( empty( $file ) ) // Some filesystems report this as /, which can cause non-expected recursive deletion of all files in the filesystem.
    241241                        return false;
    … …  
    265265        }
    266266
    267         function exists($file) {
     267        public function exists($file) {
    268268                return @file_exists($file);
    269269        }
    270270
    271         function is_file($file) {
     271        public function is_file($file) {
    272272                return @is_file($file);
    273273        }
    274274
    275         function is_dir($path) {
     275        public function is_dir($path) {
    276276                return @is_dir($path);
    277277        }
    278278
    279         function is_readable($file) {
     279        public function is_readable($file) {
    280280                return @is_readable($file);
    281281        }
    282282
    283         function is_writable($file) {
     283        public function is_writable($file) {
    284284                return @is_writable($file);
    285285        }
    286286
    287         function atime($file) {
     287        public function atime($file) {
    288288                return @fileatime($file);
    289289        }
    290290
    291         function mtime($file) {
     291        public function mtime($file) {
    292292                return @filemtime($file);
    293293        }
    294294
    295         function size($file) {
     295        public function size($file) {
    296296                return @filesize($file);
    297297        }
    298298
    299         function touch($file, $time = 0, $atime = 0) {
     299        public function touch($file, $time = 0, $atime = 0) {
    300300                if ($time == 0)
    301301                        $time = time();
    … …  
    305305        }
    306306
    307         function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
     307        public function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
    308308                // safe mode fails with a trailing slash under certain PHP versions.
    309309                $path = untrailingslashit($path);
    … …  
    324324        }
    325325
    326         function rmdir($path, $recursive = false) {
     326        public function rmdir($path, $recursive = false) {
    327327                return $this->delete($path, $recursive);
    328328        }
    329329
    330         function dirlist($path, $include_hidden = true, $recursive = false) {
     330        public function dirlist($path, $include_hidden = true, $recursive = false) {
    331331                if ( $this->is_file($path) ) {
    332332                        $limit_file = basename($path);
Note: See TracChangeset for help on using the changeset viewer.