*/
public $ftp;
- public function __construct($opt = '') {
+ /**
+ *
+ * @param array $opt
+ */
+ public function __construct( $opt = '' ) {
$this->method = 'ftpsockets';
$this->errors = new WP_Error();
$this->options['password'] = $opt['password'];
}
+ /**
+ *
+ * @return bool
+ */
public function connect() {
if ( ! $this->ftp )
return false;
return $ret;
}
+ /**
+ *
+ * @return string
+ */
public function cwd() {
$cwd = $this->ftp->pwd();
if ( $cwd )
return $cwd;
}
+ /**
+ *
+ * @param string $file
+ * @return bool
+ */
public function chdir($file) {
return $this->ftp->chdir($file);
}
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 string $source
* @param string $destination
- * @param bool $overwrite
+ * @param bool $overwrite
* @return bool
*/
public function move($source, $destination, $overwrite = false ) {
}
/**
* @param string $file
- * @param bool $recursive
+ * @param bool $recursive
* @param string $type
* @return bool
*/
/**
* @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 ) {
/**
* @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 ) {
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;
}
return $ret;
}
+ /**
+ * @access public
+ */
public function __destruct() {
$this->ftp->quit();
}