Prose\UsingHost::runCommandAsUserAndIgnoreErrors PHP Method

runCommandAsUserAndIgnoreErrors() public method

public runCommandAsUserAndIgnoreErrors ( $command, $user )
    public function runCommandAsUserAndIgnoreErrors($command, $user)
    {
        // what are we doing?
        $log = usingLog()->startAction("run command '{$command}' as user '{$user}' 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);
        // make a copy of the hostDetails, so that we can override them
        $myHostDetails = clone $hostDetails;
        $myHostDetails->sshUsername = $user;
        // run the command in the guest operating system
        $result = $host->runCommand($myHostDetails, $command);
        // all done
        $log->endAction();
        return $result;
    }