WordPress 4.3
[autoinstalls/wordpress.git] / wp-admin / includes / class-wp-filesystem-ftpext.php
index f9f46e7c81d003cf17db77259defdc95617ea8db..62ade49136ec5a9c6143529280811ae3a2d1a6c7 100644 (file)
 class WP_Filesystem_FTPext extends WP_Filesystem_Base {
        public $link;
 
-       public function __construct($opt='') {
+       /**
+        *
+        * @param array $opt
+        */
+       public function __construct( $opt = '' ) {
                $this->method = 'ftpext';
                $this->errors = new WP_Error();
 
@@ -58,6 +62,10 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
                        $this->options['ssl'] = true;
        }
 
+       /**
+        *
+        * @return bool
+        */
        public function connect() {
                if ( isset($this->options['ssl']) && $this->options['ssl'] && function_exists('ftp_ssl_connect') )
                        $this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT);
@@ -376,10 +384,10 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
        /**
         * @staticvar bool $is_windows
         * @param string $line
-        * @return string
+        * @return array
         */
        public function parselisting($line) {
-               static $is_windows;
+               static $is_windows = null;
                if ( is_null($is_windows) )
                        $is_windows = stripos( ftp_systype($this->link), 'win') !== false;
 
@@ -418,6 +426,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
                        else
                                $b['type'] = 'f';
                        $b['perms'] = $lucifer[0];
+                       $b['permsn'] = $this->getnumchmodfromh( $b['perms'] );
                        $b['number'] = $lucifer[1];
                        $b['owner'] = $lucifer[2];
                        $b['group'] = $lucifer[3];
@@ -506,6 +515,9 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
                return $ret;
        }
 
+       /**
+        * @access public
+        */
        public function __destruct() {
                if ( $this->link )
                        ftp_close($this->link);