function FileTransferSSH::isFile

Overrides FileTransfer::isFile

File

includes/filetransfer/ssh.inc, line 81

Class

FileTransferSSH
The SSH connection class for the update module.

Code

public function isFile($path) {
    $file = escapeshellarg($path);
    $cmd = "[ -f {$file} ] && 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,
        ));
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.