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-ssh2.php

    r29970 r30678  
    124124        }
    125125
     126        /**
     127         * @param string $command
     128         * @param bool $returnbool
     129         */
    126130        public function run_command( $command, $returnbool = false) {
    127131
     
    145149        }
    146150
     151        /**
     152         * @param string $file
     153         * @return string|false
     154         */
    147155        public function get_contents( $file ) {
    148156                $file = ltrim($file, '/');
     
    150158        }
    151159
     160        /**
     161         * @param string $file
     162         * @return array
     163         */
    152164        public function get_contents_array($file) {
    153165                $file = ltrim($file, '/');
     
    155167        }
    156168
     169        /**
     170         * @param string $file
     171         * @param string $contents
     172         * @param int $mode
     173         * @return bool
     174         */
    157175        public function put_contents($file, $contents, $mode = false ) {
    158176                $ret = file_put_contents( 'ssh2.sftp://' . $this->sftp_link . '/' . ltrim( $file, '/' ), $contents );
     
    173191        }
    174192
     193        /**
     194         * @param string $dir
     195         * @return bool
     196         */
    175197        public function chdir($dir) {
    176198                return $this->run_command('cd ' . $dir, true);
    177199        }
    178200
     201        /**
     202         * @param string $file
     203         * @param bool $group
     204         * @param bool $recursive
     205         */
    179206        public function chgrp($file, $group, $recursive = false ) {
    180207                if ( ! $this->exists($file) )
     
    185212        }
    186213
     214        /**
     215         * @param string $file
     216         * @param int $mode
     217         * @param bool $recursive
     218         * @return bool
     219         */
    187220        public function chmod($file, $mode = false, $recursive = false) {
    188221                if ( ! $this->exists($file) )
     
    209242         *
    210243         * @param string $file    Path to the file.
    211          * @param mixed  $owner   A user name or number.
    212          * @param bool $recursive Optional. If set True changes file owner recursivly. Defaults to False.
    213          * @return bool Returns true on success or false on failure.
     244         * @param bool   $owner   A user name or number.
     245         * @param bool   $recursive Optional. If set True changes file owner recursivly. Defaults to False.
     246         * @return bool|string Returns true on success or false on failure.
    214247         */
    215248        public function chown( $file, $owner, $recursive = false ) {
     
    221254        }
    222255
     256        /**
     257         * @param string $file
     258         * @return string|false
     259         */
    223260        public function owner($file) {
    224261                $owneruid = @fileowner('ssh2.sftp://' . $this->sftp_link . '/' . ltrim($file, '/'));
     
    230267                return $ownerarray['name'];
    231268        }
    232 
     269        /**
     270         * @param string $file
     271         * @return string
     272         */
    233273        public function getchmod($file) {
    234274                return substr( decoct( @fileperms( 'ssh2.sftp://' . $this->sftp_link . '/' . ltrim( $file, '/' ) ) ), -3 );
    235275        }
    236276
     277        /**
     278         * @param string $file
     279         * @return string|false
     280         */
    237281        public function group($file) {
    238282                $gid = @filegroup('ssh2.sftp://' . $this->sftp_link . '/' . ltrim($file, '/'));
     
    245289        }
    246290
     291        /**
     292         * @param string $source
     293         * @param string $destination
     294         * @param bool $overwrite
     295         * @param int|bool $mode
     296         * @return bool
     297         */
    247298        public function copy($source, $destination, $overwrite = false, $mode = false) {
    248299                if ( ! $overwrite && $this->exists($destination) )
     
    254305        }
    255306
     307        /**
     308         * @param string $source
     309         * @param string $destination
     310         * @param bool $overwrite
     311         * @return bool
     312         */
    256313        public function move($source, $destination, $overwrite = false) {
    257314                return @ssh2_sftp_rename( $this->sftp_link, $source, $destination );
    258315        }
    259316
     317        /**
     318         * @param string $file
     319         * @param bool $recursive
     320         * @param string|bool $type
     321         * @return bool
     322         */
    260323        public function delete($file, $recursive = false, $type = false) {
    261324                if ( 'f' == $type || $this->is_file($file) )
     
    272335        }
    273336
     337        /**
     338         * @param string $file
     339         * @return bool
     340         */
    274341        public function exists($file) {
    275342                $file = ltrim($file, '/');
    276343                return file_exists('ssh2.sftp://' . $this->sftp_link . '/' . $file);
    277344        }
    278 
     345        /**
     346         * @param string $file
     347         * @return bool
     348         */
    279349        public function is_file($file) {
    280350                $file = ltrim($file, '/');
    281351                return is_file('ssh2.sftp://' . $this->sftp_link . '/' . $file);
    282352        }
    283 
     353        /**
     354         * @param string $path
     355         * @return bool
     356         */
    284357        public function is_dir($path) {
    285358                $path = ltrim($path, '/');
    286359                return is_dir('ssh2.sftp://' . $this->sftp_link . '/' . $path);
    287360        }
    288 
     361        /**
     362         * @param string $file
     363         * @return bool
     364         */
    289365        public function is_readable($file) {
    290366                $file = ltrim($file, '/');
    291367                return is_readable('ssh2.sftp://' . $this->sftp_link . '/' . $file);
    292368        }
    293 
     369        /**
     370         * @param string $file
     371         * @return bool
     372         */
    294373        public function is_writable($file) {
    295374                $file = ltrim($file, '/');
    296375                return is_writable('ssh2.sftp://' . $this->sftp_link . '/' . $file);
    297376        }
    298 
     377        /**
     378         * @param string $file
     379         * @return int
     380         */
    299381        public function atime($file) {
    300382                $file = ltrim($file, '/');
     
    302384        }
    303385
     386        /**
     387         * @param string $file
     388         * @return int
     389         */
    304390        public function mtime($file) {
    305391                $file = ltrim($file, '/');
     
    307393        }
    308394
     395        /**
     396         * @param string $file
     397         * @return int
     398         */
    309399        public function size($file) {
    310400                $file = ltrim($file, '/');
     
    312402        }
    313403
     404        /**
     405         * @param string $file
     406         * @param int $time
     407         * @param int $atime
     408         */
    314409        public function touch($file, $time = 0, $atime = 0) {
    315410                //Not implemented.
    316411        }
    317412
     413        /**
     414         * @param string $path
     415         * @param mixed $chmod
     416         * @param mixed $chown
     417         * @param mixed $chgrp
     418         * @return bool
     419         */
    318420        public function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
    319421                $path = untrailingslashit($path);
     
    332434        }
    333435
     436        /**
     437         * @param string $path
     438         * @param bool $recursive
     439         * @return bool
     440         */
    334441        public function rmdir($path, $recursive = false) {
    335442                return $this->delete($path, $recursive);
    336443        }
    337444
     445        /**
     446         * @param string $path
     447         * @param bool $include_hidden
     448         * @param bool $recursive
     449         * @return bool|array
     450         */
    338451        public function dirlist($path, $include_hidden = true, $recursive = false) {
    339452                if ( $this->is_file($path) ) {
Note: See TracChangeset for help on using the changeset viewer.