Implements Drupal\Core\FileTransfer\ChmodInterface::chmodJailed().
Overrides ChmodInterface::chmodJailed
public function chmodJailed($path, $mode, $recursive) {
if ($recursive && is_dir($path)) {
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST) as $filename => $file) {
if (@(!chmod($filename, $mode))) {
throw new FileTransferException('Cannot chmod %path.', NULL, array(
'%path' => $filename,
));
}
}
}
elseif (@(!chmod($path, $mode))) {
throw new FileTransferException('Cannot chmod %path.', NULL, array(
'%path' => $path,
));
}
}