Executes command on connected server.

@param string $command
@param callable|null $callback

@return string
342125
public function execute($command, callable $callback = null)
    {
        $this->login();

        return $this->ssh->exec(sprintf('cd %s; %s', $this->directory, $command), $callback);
    }
381798
public function execute($command)
    {
        $this->executeDecorators($command);

        $handler = $this->commandTranslator->toCommandHandler($command);

        return $this->app->make($handler)->handle($command);
    }
503361
function execute(command, callback){
  exec(command, function(error, stdout, stderr){ callback(error, stdout); });
}
1289995
public function execute($command, callable $next)
    {

        if ($command instanceof BackgroundCommand && !$command->isRunningInBackground()) {
            return $this->runProcess($command);
        }

        return $next($command);
    }
1229070
public function executeNanbando($command, array $parameter, callable $callback = null)
    {
        $this->login();

        $parameterString = [];
        foreach ($parameter as $key => $value) {
            if (!is_array($value)) {
                $value = [$value];
            }

            foreach ($value as $item) {
                $parameterString[] = trim((is_string($key) ? $key . ' ' : '') . $item);
            }
        }

        return $this->execute(
            sprintf('%s %s %s', $this->executable, $command, implode(' ', $parameterString)),
            $callback
        );
    }
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;
    }
1164630
public function executeProcess($command)
    {
        $process = new Process($command);
        $process->setTimeout(null);
        $output = $this->output;
        $callback = function ($type, $data) use ($output) {
            $output->writeln(trim($data));
        };
        $exitCode = $process->run($callback);
        return [$exitCode, trim($process->getOutput())];
    }
530107
static function executeCommand($command)
    {
        exec($command, $output, $resultCode);

        if ($resultCode > 0) {
            $output = implode("\n", $output);
            throw new Exception("Failed to execute command: '$command' with output: '$output' ");
        }
    }
525016
public function getCommandCallbacks($command = null)
    {
        $result = array();
        if($command)
        {
            if(isset($this->__command_callbacks[$command])) {
                $result = $this->__command_callbacks[$command];
            }
        }
        else $result = $this->__command_callbacks;

        return $result;
    }
934413
public function execute($command, $params = null)
    {
        $url = $command;

        if (substr($url, -1) !== '/') {
            $url .= '/';
        }

        if ($params) {
            $parameters = array();
            foreach ($params as $k => $v) {
                if (strlen($v)) {
                    $parameters[] = urlencode($k) . '=' . urlencode($v);
                } else {
                    $parameters[] = urlencode($k);
                }
            }
            $url .= '?' . implode('&', $parameters);
        }

        try {
            $response = $this->client->get($url);
        } catch (\Exception $e) {
            return null;
        }
        $this->checkError($response, $url);

        return $response->getBody();
    }
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);
    }
608840
public function executeAdbShellCommand($command)
    {
        return $this->getDriver()->curl(
            $this->getDriver()->factoryCommand(
                'selendroid/adb/executeShellCommand',
                \WebDriver_Command::METHOD_POST,
                ['command' => $command]
            )
        );
    }
150829
public function execute($command, callable $next)
    {
        $this->entityManager->beginTransaction();

        try {
            $returnValue = $next($command);

            $this->entityManager->flush();
            $this->entityManager->commit();
        } catch (Exception $e) {
            $this->rollbackTransaction();

            throw $e;
        } catch (Throwable $e) {
            $this->rollbackTransaction();

            throw $e;
        }

        return $returnValue;
    }
618732
public function execute(interfaces\commands\Command $command)
    {
        $handler = $this->resolver->resolve($command);
        
        return call_user_func([$handler, 'handle'], $command);
    }
1283826
function doExec(callback, command) {
    let args = Array.prototype.slice.call(arguments);
    args.splice(0, 2);  //remove the first cb and command
    if (!this.isConnected()) {
      return callback(thorin.error('REDIS.NOT_CONNECTED', 'The connection is not active yet.'));
    }
    command = command.toLowerCase();
    if (typeof this[connections].default.connection[command] !== 'function') {
      return callback(thorin.error('REDIS.COMMAND_NOT_FOUND', 'Invalid command issued: ' + command, 500));
    }
    args.push((err, res) => {
      if (err) {
        return callback(thorin.error('REDIS.EXEC', 'Redis command failed to execute.', err));
      }
      if (command === 'hgetall' && typeof res === 'object' && res) {
        // backward compatibility
        if (Object.keys(res).length === 0) {
          res = null;
        }
      }
      callback(null, res);
    });
    this[connections].default.emit('command', command, args);
    this[connections].default.connection[command].apply(this[connections].default.connection, args);
  }
1314291
public function execute($command)
    {
        $deferred = new Deferred();

        if ($this->ending) {
            $deferred->reject(new RuntimeException('Shell is ending already'));
        } else {
            $this->pending []= $deferred;

            $this->sendCommand($command);
        }

        return $deferred->promise();
    }
747062
function execute($command) {
        $output = array();
        $result = null;

        // Redirect standard error to stdout so we can do something with
        // it.
        $command .= " 2>&1";

        exec($command, $output, $result);

        if ($result !== 0) {
            if ($result === self::RESULT_CODE_COMMAND_NOT_FOUND) {
                throw new CommandNotFoundError(implode("\t", $output), $result);
            }
            else {
                throw new ExecutionError(implode("\t", $output), $result);
            }
        }
        return $output;
    }