Routes command to the proper file based on the input given

@param   string  $command  The command to route
@return  void
977988
public static function routeCommand($command = 'help')
	{
		// Aliases take precedence, so parse for them first
		if ($aliases = Config::get('aliases'))
		{
			if (array_key_exists($command, $aliases))
			{
				if (strpos($aliases->$command, '::') !== false)
				{
					$bits      = explode('::', $aliases->$command);
					$command   = $bits[0];
					$aliasTask = $bits[1];
				}
				else
				{
					$command = $aliases->$command;
				}
			}
		}

		foreach (self::$commandNamespaces as $namespace)
		{
			// Check if we're targeting a namespaced command
			$bits = [];
			if (strpos($command, ':'))
			{
				$bits = explode(':', $command);
			}
			else
			{
				$bits[] = $command;
			}

			$bits = array_map('ucfirst', $bits);

			// Replace any inset placeholders
			for ($i = 0; $i < count($bits); $i++)
			{
				$loc = $i + 1;
				if (strpos($namespace, "{\$$loc}"))
				{
					$namespace = str_replace("{\$$loc}", $bits[$i], $namespace);
					unset($bits[$i]);
				}
			}

			// Add any remaining bits to the end of the command namespace
			if (count($bits) > 0)
			{
				$namespace .= '\\' . implode('\\', $bits);
			}

			// Check for existence
			if (class_exists($namespace))
			{
				$class = $namespace;
				break;
			}
		}

		if (!isset($class))
		{
			throw new UnsupportedCommandException("Unknown command: {$command}.");
		}

		return $class;
	}
885159
protected function callBrowser($command)
    {
        $setNodePathCommand     = "NODE_PATH=`{$this->npmBinary} root -g`";
        $binPath                = dirname(dirname(__DIR__)).'/bin/browser.js';
        $fullCommand            = "sudo ".$setIncludePathCommand.' '.$setNodePathCommand.' '.$this->nodeBinary.' '.escapeshellarg($binPath).' '.escapeshellarg(json_encode($command));
        $process                = (new Process($fullCommand))->setTimeout($this->timeout);
        $process->run();
        if (!$process->isSuccessful()) {
            throw new ProcessFailedException($process);
        }
        $response = json_decode($process->getOutput());
        if(!$response && !isset($response->response))
            return false;
        if(isset($response->response->error))
            throw new \Exception($response->response->error);
        return $response;
    }
339054
public function command($command, $method) {

        self::$commands[] = $command;
        self::$callbacks[$command] = $method;
    }
410218
public function fire(Command $command)
    {
        $this->command = $command;

        if ($command->option('verbose')) {
            $command->blockMessage('Requirements', 'Checking System Requirements ...', 'comment');
        }

        $this->checkPHPVersion();
        $this->checkExtensions();

        $this->showResults();
    }
236710
protected function registerRouteCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Commands\RouteListCommand($app);
        });
    }
22803
public function exec($command) {
		$this->connectIfNeeded();
		$this->param = "SITE EXEC " . $command;
		$exec = true;

		if (!ftp_exec($this->handle, substr($command, strlen("SITE EXEC")))) {
			throw new FtpException(
				Yii::t('gftp', 'Could not execute command "{command}" on "{host}"', [
					'host' => $this->host, '{command}' => $this->param
				])
			);
		}
	}
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' ");
        }
    }
896789
protected function _commandEdit($command)
    {
        $entity = $this->getController()->getItem();
        $view = $this->getController()->getView()->getName();

        $layout = pick($command->layout, 'edit');

        $command->append(array('label' => AnTranslator::_('LIB-AN-ACTION-EDIT')))
        ->href($entity->getURL().'&layout='.$layout)
        ->setAttribute('data-action', 'edit');
    }
716442
private function cleanExtraCommandArgument(Command $command): void
    {
        $arguments = $command->getDefinition()->getArguments();
        if (! isset($arguments['command'])) {
            return;
        }

        unset($arguments['command']);
        $command->getDefinition()->setArguments($arguments);
    }
344069
public static function configure(Command $command)
    {
        $command->setName('migrations:list')
            ->setDescription('Prints version IDs for all available migrations ordered incrementally.')
            ->addOption(
                'newest-first',
                null,
                InputOption::VALUE_NONE,
                'Sort list in reverse order (newest first)'
            );
    }
272554
public function command($command)
    {
        if ($command instanceof CommandInterface) {
            $command->setContainer($this);
        }

        $this['console']->add($command);
    }
497658
protected function run($command)
    {
        if (array_key_exists('migrationPath', $this->config)) {
            $migrationPaths = $this->config['migrationPath'];

            if (is_string($migrationPaths)) {
                $migrationPaths = [$migrationPaths];
            }

            $this->runMigrationByPaths($migrationPaths, $command);
        } elseif (array_key_exists('migrationNamespaces', $this->config)) {
            $migrationNamespaces = $this->config['migrationNamespaces'];

            if (is_string($migrationNamespaces)) {
                $migrationNamespaces = [$migrationNamespaces];
            }

            $this->runMigrationByNamespaces($migrationNamespaces, $command);
        } else {
            $this->runMigrationByApplication($command);
        }
    }
972788
private static function _dispatch($command)
	{
		$dispatcher = self::_getDispatcher();
		$commandEvent = new CommandEvent(PluginEvents::COMMAND, $command, self::_getIO(), self::_getIO());
		$dispatcher->dispatch($commandEvent->getName(), $commandEvent);
	}
14276
protected function doSendCommand(Command $command): void
    {
        if (!$this->shouldUseGearman()) {
            $this->locator->getCommandBus()->receiveCommand($command);
            return;
        }

        $envelope = new TransportEnvelope($command, 'php');
        $channel = $this->router->forCommand($command);

        try {
            $client = $this->getClient();
            @$client->doBackground($channel, $envelope->toString(), (string)$command->get('command_id'));
            $this->validateReturnCode($client, $channel);
        } catch (\GearmanException $ge) {
            if (isset(self::$reconnectCodes[$ge->getCode()])) {
                $this->destroyClient();
                $this->locator->getCommandBus()->receiveCommand($command);
                return;
            }

            throw $ge;
        } catch (\Throwable $e) {
            throw $e;
        }
    }
1225703
public function get($command = null)
    {
        if (isset($command)) {
            $routes = $this->getList();
            return isset($routes[$command]) ? $routes[$command] : array();
        }

        return $this->route;
    }
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;
	}
1173658
public function fire(Command $command)
    {
        $this->command = $command;

        $connected = false;

        while (! $connected) {
            $host = $this->askDatabaseHost();

            $name = $this->askDatabaseName();

            $user = $this->askDatabaseUsername();

            $password = $this->askDatabasePassword();

            $this->setLaravelConfiguration($name, $user, $password, $host);

            if ($this->databaseConnectionIsValid()) {
                $connected = true;
            } else {
                $command->error('Please ensure your database credentials are valid.');
            }
        }

        $this->env->write($name, $user, $password, $host);

        $command->info('Database successfully configured');
    }