function SSH::isDirectory
Implements Drupal\Core\FileTransfer\FileTransfer::isDirectory().
WARNING: This is untested. It is not currently used, but should do the trick.
Parameters
string $path: The path to check
Return value
bool TRUE if the specified path is a directory, FALSE otherwise.
Overrides FileTransfer::isDirectory
File
- 
              core/lib/ Drupal/ Core/ FileTransfer/ SSH.php, line 96 
Class
- SSH
- The SSH connection class for the update module.
Namespace
Drupal\Core\FileTransferCode
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.', 0, [
      '@path' => $path,
    ]);
  }
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
