function SSH::copyDirectoryJailed
Copies a directory.
We need a separate method to make sure the $destination is in the jail.
Parameters
string $source: The source path.
string $destination: The destination path.
Overrides FileTransfer::copyDirectoryJailed
File
-
core/
lib/ Drupal/ Core/ FileTransfer/ SSH.php, line 57
Class
- SSH
- The SSH connection class for the update module.
Namespace
Drupal\Core\FileTransferCode
protected function copyDirectoryJailed($source, $destination) {
if (@!ssh2_exec($this->connection, 'cp -Rp ' . escapeshellarg($source) . ' ' . escapeshellarg($destination))) {
throw new FileTransferException('Cannot copy directory @directory.', 0, [
'@directory' => $source,
]);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.