Make WordPress Core


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

Add access modifier (public) to members and methods in WP_Filesystem_ftpsockets.

See #27881, #22234.

File:
1 edited

Legend:

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

    r26869 r28490  
    1616 */
    1717class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
    18         var $ftp = false;
    19         var $errors = null;
    20         var $options = array();
    21 
    22         function __construct($opt = '') {
     18        public $ftp = false;
     19        public $errors = null;
     20        public $options = array();
     21
     22        public function __construct($opt = '') {
    2323                $this->method = 'ftpsockets';
    2424                $this->errors = new WP_Error();
     
    5454        }
    5555
    56         function connect() {
     56        public function connect() {
    5757                if ( ! $this->ftp )
    5858                        return false;
     
    8181        }
    8282
    83         function get_contents( $file ) {
     83        public function get_contents( $file ) {
    8484                if ( ! $this->exists($file) )
    8585                        return false;
     
    114114        }
    115115
    116         function get_contents_array($file) {
     116        public function get_contents_array($file) {
    117117                return explode("\n", $this->get_contents($file) );
    118118        }
    119119
    120         function put_contents($file, $contents, $mode = false ) {
     120        public function put_contents($file, $contents, $mode = false ) {
    121121                $temp = wp_tempnam( $file );
    122122                if ( ! $temphandle = @fopen($temp, 'w+') ) {
     
    152152        }
    153153
    154         function cwd() {
     154        public function cwd() {
    155155                $cwd = $this->ftp->pwd();
    156156                if ( $cwd )
     
    159159        }
    160160
    161         function chdir($file) {
     161        public function chdir($file) {
    162162                return $this->ftp->chdir($file);
    163163        }
    164164
    165         function chgrp($file, $group, $recursive = false ) {
    166                 return false;
    167         }
    168 
    169         function chmod($file, $mode = false, $recursive = false ) {
     165        public function chgrp($file, $group, $recursive = false ) {
     166                return false;
     167        }
     168
     169        public function chmod($file, $mode = false, $recursive = false ) {
    170170                if ( ! $mode ) {
    171171                        if ( $this->is_file($file) )
     
    188188        }
    189189
    190         function owner($file) {
     190        public function owner($file) {
    191191                $dir = $this->dirlist($file);
    192192                return $dir[$file]['owner'];
    193193        }
    194194
    195         function getchmod($file) {
     195        public function getchmod($file) {
    196196                $dir = $this->dirlist($file);
    197197                return $dir[$file]['permsn'];
    198198        }
    199199
    200         function group($file) {
     200        public function group($file) {
    201201                $dir = $this->dirlist($file);
    202202                return $dir[$file]['group'];
    203203        }
    204204
    205         function copy($source, $destination, $overwrite = false, $mode = false) {
     205        public function copy($source, $destination, $overwrite = false, $mode = false) {
    206206                if ( ! $overwrite && $this->exists($destination) )
    207207                        return false;
     
    214214        }
    215215
    216         function move($source, $destination, $overwrite = false ) {
     216        public function move($source, $destination, $overwrite = false ) {
    217217                return $this->ftp->rename($source, $destination);
    218218        }
    219219
    220         function delete($file, $recursive = false, $type = false) {
     220        public function delete($file, $recursive = false, $type = false) {
    221221                if ( empty($file) )
    222222                        return false;
     
    229229        }
    230230
    231         function exists( $file ) {
     231        public function exists( $file ) {
    232232                $list = $this->ftp->nlist( $file );
    233233                return !empty( $list ); //empty list = no file, so invert.
     
    235235        }
    236236
    237         function is_file($file) {
     237        public function is_file($file) {
    238238                if ( $this->is_dir($file) )
    239239                        return false;
     
    243243        }
    244244
    245         function is_dir($path) {
     245        public function is_dir($path) {
    246246                $cwd = $this->cwd();
    247247                if ( $this->chdir($path) ) {
     
    252252        }
    253253
    254         function is_readable($file) {
     254        public function is_readable($file) {
    255255                return true;
    256256        }
    257257
    258         function is_writable($file) {
     258        public function is_writable($file) {
    259259                return true;
    260260        }
    261261
    262         function atime($file) {
    263                 return false;
    264         }
    265 
    266         function mtime($file) {
     262        public function atime($file) {
     263                return false;
     264        }
     265
     266        public function mtime($file) {
    267267                return $this->ftp->mdtm($file);
    268268        }
    269269
    270         function size($file) {
     270        public function size($file) {
    271271                return $this->ftp->filesize($file);
    272272        }
    273273
    274         function touch($file, $time = 0, $atime = 0 ) {
    275                 return false;
    276         }
    277 
    278         function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) {
     274        public function touch($file, $time = 0, $atime = 0 ) {
     275                return false;
     276        }
     277
     278        public function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) {
    279279                $path = untrailingslashit($path);
    280280                if ( empty($path) )
     
    293293        }
    294294
    295         function rmdir($path, $recursive = false ) {
     295        public function rmdir($path, $recursive = false ) {
    296296                $this->delete($path, $recursive);
    297297        }
    298298
    299         function dirlist($path = '.', $include_hidden = true, $recursive = false ) {
     299        public function dirlist($path = '.', $include_hidden = true, $recursive = false ) {
    300300                if ( $this->is_file($path) ) {
    301301                        $limit_file = basename($path);
     
    346346        }
    347347
    348         function __destruct() {
     348        public function __destruct() {
    349349                $this->ftp->quit();
    350350        }
Note: See TracChangeset for help on using the changeset viewer.