Make WordPress Core

Changeset 28489


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

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

See #27881, #22234.

File:
1 edited

Legend:

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

    r26869 r28489  
    1616 */
    1717class WP_Filesystem_FTPext extends WP_Filesystem_Base {
    18     var $link;
    19     var $errors = null;
    20     var $options = array();
    21 
    22     function __construct($opt='') {
     18    public $link;
     19    public $errors = null;
     20    public $options = array();
     21
     22    public function __construct($opt='') {
    2323        $this->method = 'ftpext';
    2424        $this->errors = new WP_Error();
     
    6464    }
    6565
    66     function connect() {
     66    public function connect() {
    6767        if ( isset($this->options['ssl']) && $this->options['ssl'] && function_exists('ftp_ssl_connect') )
    6868            $this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT);
     
    8888    }
    8989
    90     function get_contents( $file ) {
     90    public function get_contents( $file ) {
    9191        $tempfile = wp_tempnam($file);
    9292        $temp = fopen($tempfile, 'w+');
     
    109109    }
    110110
    111     function get_contents_array($file) {
     111    public function get_contents_array($file) {
    112112        return explode("\n", $this->get_contents($file));
    113113    }
    114114
    115     function put_contents($file, $contents, $mode = false ) {
     115    public function put_contents($file, $contents, $mode = false ) {
    116116        $tempfile = wp_tempnam($file);
    117117        $temp = fopen( $tempfile, 'wb+' );
     
    144144    }
    145145
    146     function cwd() {
     146    public function cwd() {
    147147        $cwd = @ftp_pwd($this->link);
    148148        if ( $cwd )
     
    151151    }
    152152
    153     function chdir($dir) {
     153    public function chdir($dir) {
    154154        return @ftp_chdir($this->link, $dir);
    155155    }
    156156
    157     function chgrp($file, $group, $recursive = false ) {
     157    public function chgrp($file, $group, $recursive = false ) {
    158158        return false;
    159159    }
    160160
    161     function chmod($file, $mode = false, $recursive = false) {
     161    public function chmod($file, $mode = false, $recursive = false) {
    162162        if ( ! $mode ) {
    163163            if ( $this->is_file($file) )
     
    182182    }
    183183
    184     function owner($file) {
     184    public function owner($file) {
    185185        $dir = $this->dirlist($file);
    186186        return $dir[$file]['owner'];
    187187    }
    188188
    189     function getchmod($file) {
     189    public function getchmod($file) {
    190190        $dir = $this->dirlist($file);
    191191        return $dir[$file]['permsn'];
    192192    }
    193193
    194     function group($file) {
     194    public function group($file) {
    195195        $dir = $this->dirlist($file);
    196196        return $dir[$file]['group'];
    197197    }
    198198
    199     function copy($source, $destination, $overwrite = false, $mode = false) {
     199    public function copy($source, $destination, $overwrite = false, $mode = false) {
    200200        if ( ! $overwrite && $this->exists($destination) )
    201201            return false;
     
    206206    }
    207207
    208     function move($source, $destination, $overwrite = false) {
     208    public function move($source, $destination, $overwrite = false) {
    209209        return ftp_rename($this->link, $source, $destination);
    210210    }
    211211
    212     function delete($file, $recursive = false, $type = false) {
     212    public function delete($file, $recursive = false, $type = false) {
    213213        if ( empty($file) )
    214214            return false;
     
    225225    }
    226226
    227     function exists($file) {
     227    public function exists($file) {
    228228        $list = @ftp_nlist($this->link, $file);
    229229        return !empty($list); //empty list = no file, so invert.
    230230    }
    231231
    232     function is_file($file) {
     232    public function is_file($file) {
    233233        return $this->exists($file) && !$this->is_dir($file);
    234234    }
    235235
    236     function is_dir($path) {
     236    public function is_dir($path) {
    237237        $cwd = $this->cwd();
    238238        $result = @ftp_chdir($this->link, trailingslashit($path) );
     
    244244    }
    245245
    246     function is_readable($file) {
     246    public function is_readable($file) {
    247247        return true;
    248248    }
    249249
    250     function is_writable($file) {
     250    public function is_writable($file) {
    251251        return true;
    252252    }
    253253
    254     function atime($file) {
     254    public function atime($file) {
    255255        return false;
    256256    }
    257257
    258     function mtime($file) {
     258    public function mtime($file) {
    259259        return ftp_mdtm($this->link, $file);
    260260    }
    261261
    262     function size($file) {
     262    public function size($file) {
    263263        return ftp_size($this->link, $file);
    264264    }
    265265
    266     function touch($file, $time = 0, $atime = 0) {
     266    public function touch($file, $time = 0, $atime = 0) {
    267267        return false;
    268268    }
    269269
    270     function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
     270    public function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
    271271        $path = untrailingslashit($path);
    272272        if ( empty($path) )
     
    283283    }
    284284
    285     function rmdir($path, $recursive = false) {
     285    public function rmdir($path, $recursive = false) {
    286286        return $this->delete($path, $recursive);
    287287    }
    288288
    289     function parselisting($line) {
     289    public function parselisting($line) {
    290290        static $is_windows;
    291291        if ( is_null($is_windows) )
     
    360360    }
    361361
    362     function dirlist($path = '.', $include_hidden = true, $recursive = false) {
     362    public function dirlist($path = '.', $include_hidden = true, $recursive = false) {
    363363        if ( $this->is_file($path) ) {
    364364            $limit_file = basename($path);
     
    409409    }
    410410
    411     function __destruct() {
     411    public function __destruct() {
    412412        if ( $this->link )
    413413            ftp_close($this->link);
Note: See TracChangeset for help on using the changeset viewer.