Make WordPress Core

Changeset 30678


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.

Location:
trunk/src/wp-admin/includes
Files:
5 edited

Legend:

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

    r29454 r30678  
    470470         *
    471471         * @since 2.5.0
    472          *
     472         * @abstract
    473473         * @return bool True on success or false on failure (always true for WP_Filesystem_Direct).
    474474         */
     
    481481         *
    482482         * @since 2.5.0
    483          *
     483         * @abstract
    484484         * @param string $file Name of the file to read.
    485          * @return string|bool Returns the read data or false on failure.
     485         * @return mixed|bool Returns the read data or false on failure.
    486486         */
    487487        public function get_contents( $file ) {
     
    493493         *
    494494         * @since 2.5.0
    495          *
     495         * @abstract
    496496         * @param string $file Path to the file.
    497497         * @return array|bool the file contents in an array or false on failure.
     
    505505         *
    506506         * @since 2.5.0
    507          *
     507         * @abstract
    508508         * @param string $file     Remote path to the file where to write the data.
    509509         * @param string $contents The data to write.
     
    519519         *
    520520         * @since 2.5.0
    521          *
     521         * @abstract
    522522         * @return string|bool The current working directory on success, or false on failure.
    523523         */
     
    530530         *
    531531         * @since 2.5.0
    532          *
     532         * @abstract
    533533         * @param string $dir The new current directory.
    534534         * @return bool Returns true on success or false on failure.
     
    542542         *
    543543         * @since 2.5.0
    544          *
     544         * @abstract
    545545         * @param string $file      Path to the file.
    546546         * @param mixed  $group     A group name or number.
     
    556556         *
    557557         * @since 2.5.0
    558          *
     558         * @abstract
    559559         * @param string $file      Path to the file.
    560560         * @param int    $mode      Optional. The permissions as octal number, usually 0644 for files, 0755 for dirs.
     
    570570         *
    571571         * @since 2.5.0
    572          *
     572         * @abstract
    573573         * @param string $file Path to the file.
    574574         * @return string|bool Username of the user or false on error.
     
    582582         *
    583583         * @since 2.5.0
    584          *
     584         * @abstract
    585585         * @param string $file Path to the file.
    586586         * @return string|bool The group or false on error.
     
    594594         *
    595595         * @since 2.5.0
    596          *
     596         * @abstract
    597597         * @param string $source      Path to the source file.
    598598         * @param string $destination Path to the destination file.
     
    611611         *
    612612         * @since 2.5.0
    613          *
     613         * @abstract
    614614         * @param string $source      Path to the source file.
    615615         * @param string $destination Path to the destination file.
     
    626626         *
    627627         * @since 2.5.0
    628          *
     628         * @abstract
    629629         * @param string $file      Path to the file.
    630630         * @param bool   $recursive Optional. If set True changes file group recursively. Defaults to False.
     
    642642         *
    643643         * @since 2.5.0
    644          *
     644         * @abstract
    645645         * @param string $file Path to file/directory.
    646646         * @return bool Whether $file exists or not.
     
    654654         *
    655655         * @since 2.5.0
    656          *
     656         * @abstract
    657657         * @param string $file File path.
    658658         * @return bool Whether $file is a file.
     
    666666         *
    667667         * @since 2.5.0
    668          *
     668         * @abstract
    669669         * @param string $path Directory path.
    670670         * @return bool Whether $path is a directory.
     
    678678         *
    679679         * @since 2.5.0
    680          *
     680         * @abstract
    681681         * @param string $file Path to file.
    682682         * @return bool Whether $file is readable.
     
    690690         *
    691691         * @since 2.5.0
    692          *
    693          * @param string $path Path to file/directory.
     692         * @abstract
    694693         * @return bool Whether $file is writable.
    695694         */
     
    702701         *
    703702         * @since 2.5.0
    704          *
     703         * @abstract
    705704         * @param string $file Path to file.
    706          * @return int Unix timestamp representing last access time.
     705         * @return int|bool Unix timestamp representing last access time.
    707706         */
    708707        public function atime( $file ) {
     
    714713         *
    715714         * @since 2.5.0
    716          *
     715         * @abstract
    717716         * @param string $file Path to file.
    718          * @return int Unix timestamp representing modification time.
     717         * @return int|bool Unix timestamp representing modification time.
    719718         */
    720719        public function mtime( $file ) {
     
    726725         *
    727726         * @since 2.5.0
    728          *
     727         * @abstract
    729728         * @param string $file Path to file.
    730          * @return int Size of the file in bytes.
     729         * @return int|bool Size of the file in bytes.
    731730         */
    732731        public function size( $file ) {
     
    740739         *
    741740         * @since 2.5.0
    742          *
     741         * @abstract
    743742         * @param string $file  Path to file.
    744743         * @param int    $time  Optional. Modified time to set for file.
     
    756755         *
    757756         * @since 2.5.0
    758          *
     757         * @abstract
    759758         * @param string $path  Path for new directory.
    760759         * @param mixed  $chmod Optional. The permissions as octal number, (or False to skip chmod)
     
    774773         *
    775774         * @since 2.5.0
    776          *
     775         * @abstract
    777776         * @param string $path      Path to directory.
    778777         * @param bool   $recursive Optional. Whether to recursively remove files/directories.
     
    788787         *
    789788         * @since 2.5.0
    790          *
     789         * @abstract
    791790         * @param string $path           Path to directory or file.
    792791         * @param bool   $include_hidden Optional. Whether to include details of hidden ("." prefixed) files.
  • trunk/src/wp-admin/includes/class-wp-filesystem-direct.php

    r29206 r30678  
    201201        }
    202202
     203        /**
     204         * @param string $file
     205         * @return string
     206         */
    203207        public function group($file) {
    204208                $gid = @filegroup($file);
     
    211215        }
    212216
     217        /**
     218         * @param string $source
     219         * @param string $destination
     220         * @param bool   $overwrite
     221         * @param int    $mode
     222         * @return bool
     223         */
    213224        public function copy($source, $destination, $overwrite = false, $mode = false) {
    214225                if ( ! $overwrite && $this->exists($destination) )
     
    221232        }
    222233
     234        /**
     235         * @param string $source
     236         * @param string $destination
     237         * @param bool $overwrite
     238         * @return bool
     239         */
    223240        public function move($source, $destination, $overwrite = false) {
    224241                if ( ! $overwrite && $this->exists($destination) )
     
    237254        }
    238255
     256        /**
     257         * @param string $file
     258         * @param bool $recursive
     259         * @param string $type
     260         * @return bool
     261         */
    239262        public function delete($file, $recursive = false, $type = false) {
    240263                if ( empty( $file ) ) // Some filesystems report this as /, which can cause non-expected recursive deletion of all files in the filesystem.
     
    264287                return $retval;
    265288        }
    266 
     289        /**
     290         * @param string $file
     291         * @return bool
     292         */
    267293        public function exists($file) {
    268294                return @file_exists($file);
    269295        }
    270 
     296        /**
     297         * @param string $file
     298         * @return bool
     299         */
    271300        public function is_file($file) {
    272301                return @is_file($file);
    273302        }
    274 
     303        /**
     304         * @param string $path
     305         * @return bool
     306         */
    275307        public function is_dir($path) {
    276308                return @is_dir($path);
    277309        }
    278310
     311        /**
     312         * @param string $file
     313         * @return bool
     314         */
    279315        public function is_readable($file) {
    280316                return @is_readable($file);
    281317        }
    282318
     319        /**
     320         * @param string $file
     321         * @return bool
     322         */
    283323        public function is_writable($file) {
    284324                return @is_writable($file);
    285325        }
    286326
     327        /**
     328         * @param string $file
     329         * @return int
     330         */
    287331        public function atime($file) {
    288332                return @fileatime($file);
    289333        }
    290334
     335        /**
     336         * @param string $file
     337         * @return int
     338         */
    291339        public function mtime($file) {
    292340                return @filemtime($file);
    293341        }
    294342
     343        /**
     344         * @param string $file
     345         * @return int
     346         */
    295347        public function size($file) {
    296348                return @filesize($file);
    297349        }
    298350
     351        /**
     352         * @param string $file
     353         * @param int $time
     354         * @param int $atime
     355         * @return bool
     356         */
    299357        public function touch($file, $time = 0, $atime = 0) {
    300358                if ($time == 0)
     
    305363        }
    306364
     365        /**
     366         * @param string $path
     367         * @param mixed  $chmod
     368         * @param mixed  $chown
     369         * @param mixed  $chgrp
     370         * @return bool
     371         */
    307372        public function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
    308373                // Safe mode fails with a trailing slash under certain PHP versions.
     
    324389        }
    325390
     391        /**
     392         * @param string $path
     393         * @param bool $recursive
     394         * @return type
     395         */
    326396        public function rmdir($path, $recursive = false) {
    327397                return $this->delete($path, $recursive);
    328398        }
    329399
     400        /**
     401         * @param string $path
     402         * @param bool $include_hidden
     403         * @param bool $recursive
     404         * @return bool|array
     405         */
    330406        public function dirlist($path, $include_hidden = true, $recursive = false) {
    331407                if ( $this->is_file($path) ) {
  • trunk/src/wp-admin/includes/class-wp-filesystem-ftpext.php

    r28489 r30678  
    8888        }
    8989
     90        /**
     91         * @param string $file
     92         * @return bool|string
     93         */
    9094        public function get_contents( $file ) {
    9195                $tempfile = wp_tempnam($file);
     
    109113        }
    110114
     115        /**
     116         * @param string $file
     117         * @return array
     118         */
    111119        public function get_contents_array($file) {
    112120                return explode("\n", $this->get_contents($file));
    113121        }
    114122
     123        /**
     124         * @param string $file
     125         * @param string $contents
     126         * @param bool|string $mode
     127         * @return bool
     128         */
    115129        public function put_contents($file, $contents, $mode = false ) {
    116130                $tempfile = wp_tempnam($file);
     
    144158        }
    145159
     160        /**
     161         * @return string
     162         */
    146163        public function cwd() {
    147164                $cwd = @ftp_pwd($this->link);
     
    151168        }
    152169
     170        /**
     171         * @param string $dir
     172         * @return bool
     173         */
    153174        public function chdir($dir) {
    154175                return @ftp_chdir($this->link, $dir);
    155176        }
    156177
     178        /**
     179         * @param string $file
     180         * @param bool $group
     181         * @param bool $recursive
     182         */
    157183        public function chgrp($file, $group, $recursive = false ) {
    158184                return false;
    159185        }
    160186
     187        /**
     188         * @param string $file
     189         * @param int $mode
     190         * @param bool $recursive
     191         * @return bool
     192         */
    161193        public function chmod($file, $mode = false, $recursive = false) {
    162194                if ( ! $mode ) {
     
    182214        }
    183215
     216        /**
     217         * @param string $file
     218         * @return string
     219         */
    184220        public function owner($file) {
    185221                $dir = $this->dirlist($file);
    186222                return $dir[$file]['owner'];
    187223        }
    188 
     224        /**
     225         * @param string $file
     226         * @return string
     227         */
    189228        public function getchmod($file) {
    190229                $dir = $this->dirlist($file);
    191230                return $dir[$file]['permsn'];
    192231        }
    193 
     232        /**
     233         * @param string $file
     234         * @return string
     235         */
    194236        public function group($file) {
    195237                $dir = $this->dirlist($file);
     
    197239        }
    198240
     241        /**
     242         *
     243         * @param string $source
     244         * @param string $destination
     245         * @param bool   $overwrite
     246         * @param string|bool $mode
     247         * @return bool
     248         */
    199249        public function copy($source, $destination, $overwrite = false, $mode = false) {
    200250                if ( ! $overwrite && $this->exists($destination) )
     
    205255                return $this->put_contents($destination, $content, $mode);
    206256        }
    207 
     257        /**
     258         * @param string $source
     259         * @param string $destination
     260         * @param bool $overwrite
     261         * @return bool
     262         */
    208263        public function move($source, $destination, $overwrite = false) {
    209264                return ftp_rename($this->link, $source, $destination);
    210265        }
    211 
     266        /**
     267         * @param string $file
     268         * @param bool $recursive
     269         * @param string $type
     270         * @return bool
     271         */
    212272        public function delete($file, $recursive = false, $type = false) {
    213273                if ( empty($file) )
     
    224284                return @ftp_rmdir($this->link, $file);
    225285        }
    226 
     286        /**
     287         * @param string $file
     288         * @return bool
     289         */
    227290        public function exists($file) {
    228291                $list = @ftp_nlist($this->link, $file);
    229292                return !empty($list); //empty list = no file, so invert.
    230293        }
    231 
     294        /**
     295         * @param string $file
     296         * @return bool
     297         */
    232298        public function is_file($file) {
    233299                return $this->exists($file) && !$this->is_dir($file);
    234300        }
    235 
     301        /**
     302         * @param string $path
     303         * @return bool
     304         */
    236305        public function is_dir($path) {
    237306                $cwd = $this->cwd();
     
    244313        }
    245314
     315        /**
     316         * @param string $file
     317         * @return bool
     318         */
    246319        public function is_readable($file) {
    247320                return true;
    248321        }
    249 
     322        /**
     323         * @param string $file
     324         * @return bool
     325         */
    250326        public function is_writable($file) {
    251327                return true;
    252328        }
    253 
     329        /**
     330         * @param string $file
     331         * @return bool
     332         */
    254333        public function atime($file) {
    255334                return false;
    256335        }
    257 
     336        /**
     337         * @param string $file
     338         * @return int
     339         */
    258340        public function mtime($file) {
    259341                return ftp_mdtm($this->link, $file);
    260342        }
    261 
     343        /**
     344         * @param string $file
     345         * @return int
     346         */
    262347        public function size($file) {
    263348                return ftp_size($this->link, $file);
    264349        }
    265 
     350        /**
     351         * @param string $file
     352         * @return bool
     353         */
    266354        public function touch($file, $time = 0, $atime = 0) {
    267355                return false;
    268356        }
    269357
     358        /**
     359         * @param string $path
     360         * @param mixed $chmod
     361         * @param mixed $chown
     362         * @param mixed $chgrp
     363         * @return bool
     364         */
    270365        public function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
    271366                $path = untrailingslashit($path);
     
    283378        }
    284379
     380        /**
     381         * @param string $path
     382         * @param bool $recursive
     383         * @return bool
     384         */
    285385        public function rmdir($path, $recursive = false) {
    286386                return $this->delete($path, $recursive);
    287387        }
    288388
     389        /**
     390         * @staticvar bool $is_windows
     391         * @param string $line
     392         * @return string
     393         */
    289394        public function parselisting($line) {
    290395                static $is_windows;
     
    360465        }
    361466
     467        /**
     468         * @param string $path
     469         * @param bool $include_hidden
     470         * @param bool $recursive
     471         * @return bool|array
     472         */
    362473        public function dirlist($path = '.', $include_hidden = true, $recursive = false) {
    363474                if ( $this->is_file($path) ) {
  • 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) ) {
  • 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.