|
|
@ -28,6 +28,8 @@ class SshConnector extends CPHPBaseClass
|
|
|
|
|
|
|
|
|
|
|
|
public $helper = "~/runhelper";
|
|
|
|
public $helper = "~/runhelper";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private $cache = "";
|
|
|
|
|
|
|
|
|
|
|
|
public function RunCommand($command, $throw_exception)
|
|
|
|
public function RunCommand($command, $throw_exception)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
@ -54,6 +56,20 @@ class SshConnector extends CPHPBaseClass
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function RunCommandCached($command, $throw_exception)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(!isset($this->cache[$command]))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$result = $this->RunCommand($command, $throw_exception);
|
|
|
|
|
|
|
|
$this->cache[$command] = $result;
|
|
|
|
|
|
|
|
return $result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return $this->cache[$command];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function Connect()
|
|
|
|
public function Connect()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$options = array(
|
|
|
|
$options = array(
|
|
|
|