]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/class-wp-filesystem-ftpsockets.php
WordPress 4.3
[autoinstalls/wordpress.git] / wp-admin / includes / class-wp-filesystem-ftpsockets.php
index ec85d36b7b81ba0ee527baffc75fe8226b3e79ea..879a2e8ca8542e25d0881a4f98bbda7a26fae916 100644 (file)
@@ -20,7 +20,11 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
         */
        public $ftp;
 
         */
        public $ftp;
 
-       public function __construct($opt = '') {
+       /**
+        *
+        * @param array $opt
+        */
+       public function __construct( $opt  = '' ) {
                $this->method = 'ftpsockets';
                $this->errors = new WP_Error();
 
                $this->method = 'ftpsockets';
                $this->errors = new WP_Error();
 
@@ -52,6 +56,10 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
                        $this->options['password'] = $opt['password'];
        }
 
                        $this->options['password'] = $opt['password'];
        }
 
+       /**
+        *
+        * @return bool
+        */
        public function connect() {
                if ( ! $this->ftp )
                        return false;
        public function connect() {
                if ( ! $this->ftp )
                        return false;
@@ -163,6 +171,10 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
                return $ret;
        }
 
                return $ret;
        }
 
+       /**
+        *
+        * @return string
+        */
        public function cwd() {
                $cwd = $this->ftp->pwd();
                if ( $cwd )
        public function cwd() {
                $cwd = $this->ftp->pwd();
                if ( $cwd )
@@ -170,6 +182,11 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
                return $cwd;
        }
 
                return $cwd;
        }
 
+       /**
+        *
+        * @param string $file
+        * @return bool
+        */
        public function chdir($file) {
                return $this->ftp->chdir($file);
        }
        public function chdir($file) {
                return $this->ftp->chdir($file);
        }
@@ -226,9 +243,9 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
                return $dir[$file]['group'];
        }
        /**
                return $dir[$file]['group'];
        }
        /**
-        * @param string $source
-        * @param string $destination
-        * @param bool $overwrite
+        * @param string   $source
+        * @param string   $destination
+        * @param bool     $overwrite
         * @param int|bool $mode
         * @return bool
         */
         * @param int|bool $mode
         * @return bool
         */
@@ -245,7 +262,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
        /**
         * @param string $source
         * @param string $destination
        /**
         * @param string $source
         * @param string $destination
-        * @param bool $overwrite
+        * @param bool   $overwrite
         * @return bool
         */
        public function move($source, $destination, $overwrite = false ) {
         * @return bool
         */
        public function move($source, $destination, $overwrite = false ) {
@@ -253,7 +270,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
        }
        /**
         * @param string $file
        }
        /**
         * @param string $file
-        * @param bool $recursive
+        * @param bool   $recursive
         * @param string $type
         * @return bool
         */
         * @param string $type
         * @return bool
         */
@@ -359,9 +376,9 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
 
        /**
         * @param string $path
 
        /**
         * @param string $path
-        * @param mixed $chmod
-        * @param mixed $chown
-        * @param mixed $chgrp
+        * @param mixed  $chmod
+        * @param mixed  $chown
+        * @param mixed  $chgrp
         * @return bool
         */
        public function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) {
         * @return bool
         */
        public function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) {
@@ -387,8 +404,8 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
 
        /**
         * @param string $path
 
        /**
         * @param string $path
-        * @param bool $include_hidden
-        * @param bool $recursive
+        * @param bool   $include_hidden
+        * @param bool   $recursive
         * @return bool|array
         */
        public function dirlist($path = '.', $include_hidden = true, $recursive = false ) {
         * @return bool|array
         */
        public function dirlist($path = '.', $include_hidden = true, $recursive = false ) {
@@ -432,6 +449,9 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
                        if ( $struc['islink'] )
                                $struc['name'] = preg_replace( '/(\s*->\s*.*)$/', '', $struc['name'] );
 
                        if ( $struc['islink'] )
                                $struc['name'] = preg_replace( '/(\s*->\s*.*)$/', '', $struc['name'] );
 
+                       // Add the Octal representation of the file permissions
+                       $struc['permsn'] = $this->getnumchmodfromh( $struc['perms'] );
+
                        $ret[ $struc['name'] ] = $struc;
                }
 
                        $ret[ $struc['name'] ] = $struc;
                }
 
@@ -440,6 +460,9 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
                return $ret;
        }
 
                return $ret;
        }
 
+       /**
+        * @access public
+        */
        public function __destruct() {
                $this->ftp->quit();
        }
        public function __destruct() {
                $this->ftp->quit();
        }