executes a command

@param string $command command

@return string
@throws \RuntimeException
425668
public function executeCommand($command)
    {
        $cmd = sprintf('%s %s', $this->binaryPath, $command);
        $p = new Process($cmd);
        $p->run();
        if ($p->isSuccessful()) {
            return $p->getOutput();
        } else {
            throw new \RuntimeException(sprintf('pygmentize failed with the error: %s', $p->getErrorOutput()));
        }
    }
773886
final public function execute($command, AnCommandContext $context)
    {
        $identifier = $context->caller->getIdentifier();

        if ($context->entity instanceof AnDomainEntityAbstract) {
            $identifier = $context->entity->getIdentifier();
        }

        $type = $identifier->path;
        $type = array_pop($type);

        $parts = explode('.', $command);
        $method = '_'.($parts[0]).ucfirst($type).ucfirst($parts[1]);

        $result = null;

        if (method_exists($this, $method)) {
            $result = $this->$method($context);
        }

        if ($context->entity) {
            $result = $context->entity->execute($command, $context);
        }

        return $result;
    }
258226
protected function executeCmd($command)
    {
        $process = new $this->processClass($command);
        $process->run();

        if (false === $process->isSuccessful() && strlen($process->getErrorOutput()) > 0) {
            throw new \RuntimeException($process->getErrorOutput());
        }

        return $process->getOutput();
    }
584392
public function executeCommand(Command $command)
    {
        if ($command instanceof DsnDependent) {
            $command->setDsn($this->dsn);
        }

        $shellCmd = self::VTCTLD_EXECUTABLE . ' ' . $this->getServerString() . ' '
             . $command->getName() . ' ' . implode(' ', $command->getParams());

        exec($shellCmd, $output, $return);
        $output = implode("\n", $output);

        if ($return !== 0) {
            throw new Exception('Error running vtctld command - ' . $shellCmd . ', error: ' . $output);
        }

        $resultClass = $command->getResultClass();

        return new $resultClass($this->dsn, $output);
    }
1242469
protected function composerRunCommand($command)
    {
        $this->info("Run \"$command\".");

        $output = [];
        exec($command, $output, $returnStatusCode);

        if ($returnStatusCode !== 0) {
            throw RuntimeException::commandExecutionFailed($command, $returnStatusCode);
        }

        $this->info("\"$command\" was successfully ran.");
    }
1365839
protected function execute($command)
    {
        $process = new Process($command);
        $process->setTimeout(null);
        $process->run();

        if (!$process->isSuccessful()) {
            throw new \RuntimeException($process->getErrorOutput());
        }
    }
14766
public function execute(string $command) : array
    {
        $this->result = [];
        $process = new Process(
            $this->propelCommand . ' ' . $command . ' --config-dir=' . $this->configDir,
            $this->rootDirectory
        );

        $process->run([$this, 'handle']);

        return $this->result;
    }
1302193
private function send(AbstractCommand $command)
    {
        $cmdId = $this->generateId();
        $this->commands->add($cmdId, $command);
        if (!$command->getClient()->send($this->serializeCommand($command, $cmdId))) {
            throw new \RuntimeException(sprintf('Fail run command "%s".', $command->getCommandName()));
        }
    }
94018
protected function executeCommand($command)
    {
        $result = @exec($command, $output, $code);
        $output = implode("\n", $output);

        if ($result === false) {
            throw new Exception("Failed to execute command '$command' with message: [$code] '$output'");
        }

        return $output;
    }
774477
public function executeCommand($command, $arguments = array())
    {
        $command = $this->client->getCommand($command, $arguments);
        return $this->client->execute($command);/*$command->getResponse()->json();*/
    }
387792
public function callCommand(string $command, array $arguments = [])
    {
        $newCommand = $this->getApplication()->find($command);

        $arguments['command'] = $command;

        return $newCommand->run(new ArrayInput($arguments), $this->getOutput());
    }
556952
protected function executeCommand($command)
    {

        $process = new Process($command);
        $process->run();

        return array(
            $process->getExitCode(),
            $process->getOutput(),
            $process->getErrorOutput(),
        );
    }
1075591
public function execute(Command $command)
    {
        $handler = $this->resolver->resolve($command);

        return $handler->handle($command);
    }
84093
public function run($command = null) {
		if ($command && !$this->request->args()) {
			return $this->_default($command);
		}
		$this->request->shift();
		$this->template = $this->template ?: $command;

		if (!$command) {
			return false;
		}
		if ($this->_execute($command)) {
			return true;
		}
		$this->error("{$command} could not be created.");
		return false;
	}
1055800
public function runAsProcessReturningProcessObject(string $command) : Process
    {
        $process = new Process($command);
        $process->run();
        $process->setTimeout(null);
        $process->setIdleTimeout(60);
        $process->wait();

        return $process;
    }
1197968
public function run($command)
    {
        $this->command = escapeshellcmd($command);
        $this->process->setCommandLine($this->command);
        $this->process->run();
        $this->validateRun();

        return $this;
    }
292959
public function dispatchToQueue($command)
    {
        $connection = $command->connection ?? null;

        $queue = call_user_func($this->queueResolver, $connection);

        if (! $queue instanceof Queue) {
            throw new RuntimeException('Queue resolver did not return a Queue implementation.');
        }

        if (method_exists($command, 'queue')) {
            return $command->queue($queue, $command);
        }

        return $this->pushCommandToQueue($queue, $command);
    }