/** * Checks if the specified tool binary exists and returns the full path. * * @param string $file Binary file to check. * * @throws Net_SSH2_Exception If the specified SSH2 binary tool was not found. * @return void */ private function _getBinaryPath($file) { //Check for ssh binary if (array_key_exists('ssh2_binary_path', $this->options)) { $ssh2_binary = escapeshellarg(File::buildpath(array($options['ssh2_binary_path'], $file))); } else { $ssh2_binary = System::which($file); } if (!is_file($ssh2_binary)) { throw new Net_SSH2_Exception(Net_SSH2::getMessage(SSH2_BINARY_NOT_FOUND, $file)); } return $ssh2_binary; }