From 535bc8acef3b3c43d7de5a2888837d71202edfab Mon Sep 17 00:00:00 2001 From: oanhnn Date: Sat, 9 Jul 2016 00:41:05 +0700 Subject: [PATCH 1/2] Add chmod in sftp feature --- src/Ssh/Sftp.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Ssh/Sftp.php b/src/Ssh/Sftp.php index e19767c..9276aad 100644 --- a/src/Ssh/Sftp.php +++ b/src/Ssh/Sftp.php @@ -238,6 +238,21 @@ public function listDirectory($directory, $recursive = false) ); } + /** + * Creates a directory + * + * @see http://php.net/manual/en/function.ssh2-sftp-chmod.php + * + * @param string $filename The filename to resolve + * @param int $mod The permissions on the new filename + * + * @return Boolean + */ + public function chmod($filename, $mod = 0600) + { + return ssh2_sftp_chmod($this->getResource(), $filename, $mod); + } + /** * {@inheritDoc} */ From 12e3cf97ab2954beb6b2d22e19a2f50211829131 Mon Sep 17 00:00:00 2001 From: Oanh Nguyen Date: Thu, 27 Apr 2017 16:45:40 +0700 Subject: [PATCH 2/2] Fix incorrect comment --- src/Ssh/Sftp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ssh/Sftp.php b/src/Ssh/Sftp.php index 9276aad..b929287 100644 --- a/src/Ssh/Sftp.php +++ b/src/Ssh/Sftp.php @@ -239,7 +239,7 @@ public function listDirectory($directory, $recursive = false) } /** - * Creates a directory + * Change the access permissions to file system objects * * @see http://php.net/manual/en/function.ssh2-sftp-chmod.php *