Run some commands on this computer
@param array $command commands to run
@return \Compiler $this
966018
private function runLocal($command) {
		// make commands a list
		if (!is_array($command))
			$command = array($command);
		$command = strval(implode(' ', $command));


		// run
		if ($this->verbose >= 3) {
			echo "\n$ $command\n";
			passthru($command);
		} else
			exec($command);

		return $this;
	}
301137
public function runCommand(Command $command, array $parameters = [], OutputInterface $output = null)
    {
        $parameters['command'] = $command->getName();
        $input = new ArrayInput($parameters);

        if ($output === null) {
            $output = new NullOutput();
        }

        $command->setApplication(new SymfonyConsoleApplication());

        return $command->run($input, $output);
    }
1209845
public function addCommand(Command $command)
    {
        if (is_string($command)) {
            $command = new $command;
        }
        $map = (new CommandMapping($this->parser))->map($command);

        CommandBag::add($map->name, [
            'object' => $command,
            'map' => $map
        ]);

        return $this;
    }
470124
public function callSilent($command, array $arguments = []) {
		$instance = $this->getApplication()->find($command);
		$arguments['command'] = $command;

		return $instance->run(new ArrayInput($arguments), new NullOutput);
	}
116464
public function runCommand($commandName, array $args = [])
    {
        $application = $this->getApplication();

        $command = $application->find($commandName);

        $arrayInput = new ArrayInput($args);

        $arrayInput->setInteractive(false);

        $command->run($arrayInput, $this->getOutput());
    }
289368
protected function runCommand(Command $command, array $argv, ConsoleIo $io)
    {
        try {
            return $command->run($argv, $io);
        } catch (StopException $e) {
            return $e->getCode();
        }
    }
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;
    }
114443
private function execCommand(array $command): array
  {
    $this->logVerbose('Execute: %s', implode(' ', $command));
    list($output, $ret) = ProgramExecution::exec1($command, null);
    if ($ret!=0)
    {
      foreach ($output as $line)
      {
        $this->logInfo($line);
      }
      $this->logError("Error executing '%s'.", implode(' ', $command));
    }
    else
    {
      foreach ($output as $line)
      {
        $this->logVerbose($line);
      }
    }

    return $output;
  }
471879
public function run(array $args)
    {
        $command = (string)$args[1];
        $this->router->match($command);
        $args = array_slice($args, 2);

        return $this->router->executeCommand($args);
    }
58230
protected function registerMakeJobCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Generators\Commands\JobMakeCommand($app);
        });
    }
860155
public function addCommands(array $commands, CommandInterface $before = null)
    {
        foreach ($commands as $command) {
            $this->addCommand($command, $before);
        }

        return $this;
    }
1107523
private function executeCommand(array $command, array $options)
    {
        return $this
            ->getCommandExecutor()
            ->executeCommand(
                $this->manager,
                $this->databaseName,
                $command,
                $options
            );
    }
379024
public function runCommand($command, array $parameters = [], $silent = false)
    {
        $class = $this->make($command);
        if ($class instanceof Command) {
            if ($silent) {
                $class->setSilent(true);
            }
            $class->run($parameters);
        } else {
            throw new ConsoleException('Class has to be a instance of '.Command::class.'!');
        }
    }
421458
public function runCommand($command)
    {
        $folder = dirname($this->file);
        $olddir = getcwd();
        chdir($folder);
        
        ob_start();
        $output = null;
        $cmd = system('composer ' . $command, $output);
        $output = ob_end_clean();
        chdir($olddir);
        
        return $cmd === false ? false : true;
    }
387792
public function callCommand(string $command, array $arguments = [])
    {
        $newCommand = $this->getApplication()->find($command);

        $arguments['command'] = $command;

        return $newCommand->run(new ArrayInput($arguments), $this->getOutput());
    }
1113628
public function execute($command = null, array $args = array(), array $options = array())
    {
        $command = $command ?: $this->defaultCommand;
        if (!isset($this->commands[$command])) {
            throw new ConsoleException("Command '$command' does not exist");
        }
        
        $callback = $this->commands[$command];
        if (is_callable($callback)) {
            $params = array($args, $options);
            if (is_string($callback)) {
                if (strpos($callback, '::') !== false) {
                    list($classname, $methodname) = explode('::', $callback);
                    $reflection = new ReflectionMethod($classname, $methodname);
                } else {
                    $reflection = new ReflectionFunction($callback);
                }
                $params = Utils::computeFuncParams($reflection, $args, $options);
            }
            $params[] = $this;
            return call_user_func_array($callback, $params);
        }

        $method = new ReflectionMethod($callback, 'execute');
        $params = Utils::computeFuncParams($method, $args, $options);
        return $method->invokeArgs(new $callback($this), $params);
    }
611624
public function run(string $command) : Process {
        $mutedCommand = Str::startsWith($command, 'artisan')
            ? str_replace('artisan ', '', $command)
            : $command;

        ignore_user_abort();

        $logName    = explode(' -', $mutedCommand, 2)[0];
        $log        = storage_path('logs' . DIRECTORY_SEPARATOR . snake_case(Str::slug($logName)) . '.log');
        $rootPath   = base_path();

        shell_exec("cd $rootPath && php artisan $mutedCommand >> " . $log . " &");

        exec('pgrep php', $processIds);
        exec('ps ahxwwo pid:1,command:1 | grep php | grep -v grep | grep -v emacs', $processes);

        $this->check();

        return $this->getProcessByCommand($command);
    }