Make WordPress Core


Ignore:
Timestamp:
12/01/2014 12:12:05 AM (12 years ago)
Author:
wonderboymusic
Message:

Improve various @param docs for src/wp-admin/includes/class-wp-filesystem-*.php.

See #30224.

File:
1 edited

Legend:

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

    r29206 r30678  
    8282        }
    8383
     84        /**
     85         * @param string $file
     86         * @return bool|string
     87         */
    8488        public function get_contents( $file ) {
    8589                if ( ! $this->exists($file) )
     
    114118                return $contents;
    115119        }
    116 
     120        /**
     121         * @param string $file
     122         * @return array
     123         */
    117124        public function get_contents_array($file) {
    118125                return explode("\n", $this->get_contents($file) );
    119126        }
    120127
     128        /**
     129         * @param string $file
     130         * @param string $contents
     131         * @param int|bool $mode
     132         * @return bool
     133         */
    121134        public function put_contents($file, $contents, $mode = false ) {
    122135                $temp = wp_tempnam( $file );
     
    164177        }
    165178
     179        /**
     180         * @param string $file
     181         * @param bool $group
     182         * @param bool $recursive
     183         */
    166184        public function chgrp($file, $group, $recursive = false ) {
    167185                return false;
    168186        }
    169187
     188        /**
     189         * @param string $file
     190         * @param int|bool $mode
     191         * @param bool $recursive
     192         * @return bool
     193         */
    170194        public function chmod($file, $mode = false, $recursive = false ) {
    171195                if ( ! $mode ) {
     
    189213        }
    190214
     215        /**
     216         * @param string $file
     217         * @return string
     218         */
    191219        public function owner($file) {
    192220                $dir = $this->dirlist($file);
    193221                return $dir[$file]['owner'];
    194222        }
    195 
     223        /**
     224         * @param string $file
     225         * @return string
     226         */
    196227        public function getchmod($file) {
    197228                $dir = $this->dirlist($file);
    198229                return $dir[$file]['permsn'];
    199230        }
    200 
     231        /**
     232         * @param string $file
     233         * @return string
     234         */
    201235        public function group($file) {
    202236                $dir = $this->dirlist($file);
    203237                return $dir[$file]['group'];
    204238        }
    205 
     239        /**
     240         * @param string $source
     241         * @param string $destination
     242         * @param bool $overwrite
     243         * @param int|bool $mode
     244         * @return bool
     245         */
    206246        public function copy($source, $destination, $overwrite = false, $mode = false) {
    207247                if ( ! $overwrite && $this->exists($destination) )
     
    214254                return $this->put_contents($destination, $content, $mode);
    215255        }
    216 
     256        /**
     257         * @param string $source
     258         * @param string $destination
     259         * @param bool $overwrite
     260         * @return bool
     261         */
    217262        public function move($source, $destination, $overwrite = false ) {
    218263                return $this->ftp->rename($source, $destination);
    219264        }
    220 
     265        /**
     266         * @param string $file
     267         * @param bool $recursive
     268         * @param string $type
     269         * @return bool
     270         */
    221271        public function delete($file, $recursive = false, $type = false) {
    222272                if ( empty($file) )
     
    230280        }
    231281
     282        /**
     283         * @param string $file
     284         * @return bool
     285         */
    232286        public function exists( $file ) {
    233287                $list = $this->ftp->nlist( $file );
     
    236290        }
    237291
     292        /**
     293         * @param string $file
     294         * @return bool
     295         */
    238296        public function is_file($file) {
    239297                if ( $this->is_dir($file) )
     
    244302        }
    245303
     304        /**
     305         * @param string $path
     306         * @return bool
     307         */
    246308        public function is_dir($path) {
    247309                $cwd = $this->cwd();
     
    253315        }
    254316
     317        /**
     318         * @param string $file
     319         * @return bool
     320         */
    255321        public function is_readable($file) {
    256322                return true;
    257323        }
    258324
     325        /**
     326         * @param string $file
     327         * @return bool
     328         */
    259329        public function is_writable($file) {
    260330                return true;
    261331        }
    262332
     333        /**
     334         * @param string $file
     335         * @return bool
     336         */
    263337        public function atime($file) {
    264338                return false;
    265339        }
    266340
     341        /**
     342         * @param string $file
     343         * @return int
     344         */
    267345        public function mtime($file) {
    268346                return $this->ftp->mdtm($file);
    269347        }
    270348
     349        /**
     350         * @param string $file
     351         * @return int
     352         */
    271353        public function size($file) {
    272354                return $this->ftp->filesize($file);
    273355        }
    274 
     356        /**
     357         * @param string $file
     358         * @param int $time
     359         * @param int $atime
     360         * @return bool
     361         */
    275362        public function touch($file, $time = 0, $atime = 0 ) {
    276363                return false;
    277364        }
    278365
     366        /**
     367         * @param string $path
     368         * @param mixed $chmod
     369         * @param mixed $chown
     370         * @param mixed $chgrp
     371         * @return bool
     372         */
    279373        public function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) {
    280374                $path = untrailingslashit($path);
     
    294388        }
    295389
     390        /**
     391         * @param sting $path
     392         * @param bool $recursive
     393         */
    296394        public function rmdir($path, $recursive = false ) {
    297395                $this->delete($path, $recursive);
    298396        }
    299397
     398        /**
     399         * @param string $path
     400         * @param bool $include_hidden
     401         * @param bool $recursive
     402         * @return bool|array
     403         */
    300404        public function dirlist($path = '.', $include_hidden = true, $recursive = false ) {
    301405                if ( $this->is_file($path) ) {
Note: See TracChangeset for help on using the changeset viewer.