On this page
function FileTransferFTPExtension::chmodJailed
FileTransferFTPExtension::chmodJailed($path, $mode, $recursive)
Changes the permissions of the file / directory specified in $path
Parameters
string $path: Path to change permissions of.
long $mode: The new file permission mode to be passed to chmod().
boolean $recursive: Pass TRUE to recursively chmod the entire directory specified in $path.
Overrides FileTransferChmodInterface::chmodJailed
File
- includes/filetransfer/ftp.inc, line 123
Class
Code
function chmodJailed($path, $mode, $recursive) {
if (!ftp_chmod($this->connection, $mode, $path)) {
throw new FileTransferException("Unable to set permissions on %file", NULL, array('%file' => $path));
}
if ($this->isDirectory($path) && $recursive) {
$filelist = @ftp_nlist($this->connection, $path);
if (!$filelist) {
//empty directory - returns false
return;
}
foreach ($filelist as $file) {
$this->chmodJailed($file, $mode, $recursive);
}
}
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!filetransfer!ftp.inc/function/FileTransferFTPExtension::chmodJailed/7.x