You are here

protected function SSH::copyDirectoryJailed in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/FileTransfer/SSH.php \Drupal\Core\FileTransfer\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 62
Contains \Drupal\Core\FileTransfer\SSH.

Class

SSH
The SSH connection class for the update module.

Namespace

Drupal\Core\FileTransfer

Code

protected function copyDirectoryJailed($source, $destination) {
  if (@(!ssh2_exec($this->connection, 'cp -Rp ' . escapeshellarg($source) . ' ' . escapeshellarg($destination)))) {
    throw new FileTransferException('Cannot copy directory @directory.', NULL, array(
      '@directory' => $source,
    ));
  }
}