Prose\UsingHost::runCommand PHP Метод

runCommand() публичный Метод

public runCommand ( $command )
    public function runCommand($command)
    {
        // what are we doing?
        $log = usingLog()->startAction("run command '{$command}' on host '{$this->args[0]}'");
        // make sure we have valid host details
        $hostDetails = $this->getHostDetails();
        // get an object to talk to this host
        $host = OsLib::getHostAdapter($this->st, $hostDetails->osName);
        // run the command in the guest operating system
        $result = $host->runCommand($hostDetails, $command);
        // did the command succeed?
        if ($result->didCommandFail()) {
            $msg = "command failed with return code '{$result->returnCode}' and output '{$result->output}'";
            $log->endAction($msg);
            throw new E5xx_ActionFailed(__METHOD__, $msg);
        }
        // all done
        $log->endAction();
        return $result;
    }