public function FileTransferSSH::isDirectory
public FileTransferSSH::isDirectory($path)
WARNING: This is untested. It is not currently used, but should do the trick.
Overrides FileTransfer::isDirectory
File
- includes/filetransfer/ssh.inc, line 67
Class
- FileTransferSSH
- The SSH connection class for the update module.
Code
public function isDirectory($path) { $directory = escapeshellarg($path); $cmd = "[ -d {$directory} ] && echo 'yes'"; if ($output = @ssh2_exec($this->connection, $cmd)) { if ($output == 'yes') { return TRUE; } return FALSE; } else { throw new FileTransferException('Cannot check @path.', NULL, array('@path' => $path)); } }
© 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!ssh.inc/function/FileTransferSSH::isDirectory/7.x