Returns all registered commands.

@return array
5216
protected function getCommands(): array
	{
		// Define core commands

		$commands =
		[
			'app.generate_key'    => GenerateKey::class,
			'app.generate_secret' => GenerateSecret::class,
		];

		if($this->container->has(Routes::class))
		{
			$commands = array_merge($commands,
			[
				'app.routes' => ListRoutes::class,
				'server'     => Server::class,
			]);
		}

		if($this->container->has(CacheManager::class))
		{
			$commands = array_merge($commands,
			[
				'cache.remove' => Remove::class,
				'cache.clear'  => Clear::class,
			]);
		}

		if($this->container->has(DatabaseConnectionManager::class))
		{
			$commands = array_merge($commands,
			[
				'migrate.create' => Create::class,
				'migrate.status' => Status::class,
				'migrate.up'     => Up::class,
				'migrate.down'   => Down::class,
				'migrate.reset'  => Reset::class,
			]);
		}

		// Add application commands

		$commands += $this->config->get('application.commands');

		// Add package commands

		foreach($this->packages as $package)
		{
			$commands += $package->getCommands();
		}

		// Return commands

		return $commands;
	}
296117
public function getNamespaces() {
        $namespaces = [];
        foreach ($this->commands as $command) {
            $namespaces = array_merge($namespaces, $this->extractAllNamespaces($command->getName()));

            foreach ($command->getAliases() as $alias) {
                $namespaces = array_merge($namespaces, $this->extractAllNamespaces($alias));
            }
        }

        return array_values(array_unique(array_filter($namespaces)));
    }
185678
protected function getCommands(): array
	{
		$info = [];

		foreach($this->commands as $name => $class)
		{
			$command = $this->instantiateCommandWithoutConstructor($class);

			$info[$name] = [$name, $command->getCommandDescription()];
		}

		ksort($info);

		return $info;
	}
237569
public function registerCommands()
    {
        foreach ($this->commandsStack as $key => $command) {
            $this->resolveConsoleCommand('\\'.$command);
        }

        return $this;
    }
256873
public function defaultCommands()
    {
        return [
            'server' => [
                'class' => ServerCommand::class,
            ],
            'server:start' => [
                'class' => ServerStartCommand::class,
            ],
            'server:stop' => [
                'class' => ServerStopCommand::class,
            ],
            'server:restart' => [
                'class' => ServerRestartCommand::class,
            ],
            'server:reload' => [
                'class' => ServerReloadCommand::class,
            ],
            'server:serve' => [
                'class' => ServerServeCommand::class,
            ],
            'shell' => [
                'class' => ShellCommand::class,
            ],
            'service:install' => [
                'class' => ServiceInstallCommand::class,
            ],
            'service:uninstall' => [
                'class' => ServiceUninstallCommand::class,
            ],
        ];
    }
1284726
public function getAllControlHandlers() {
        $result = array();
        foreach ($this->instances as $instance) {
            if ($instance instanceof ControlHandler) {
                $result[] = $instance;
            }
        }
        return $result;
    }
895886
protected function getAllOptions()
    {
        if (!$this->command) {
            return $this->application->getDefinition()->getOptions();
        }

        return array_merge(
            $this->command->getNativeDefinition()->getOptions(),
            $this->application->getDefinition()->getOptions()
        );
    }
465468
public function getChatCommands()
    {
        $chatCommands = [];
        foreach ($this->commands as $chatCommand => $data) {
            $chatCommands[$data->getCommand()] = clone $data;
        }

        return $chatCommands;
    }
523642
public function getCommandline(): array
    {
        $args = $this->getArguments();
        if ($this->executable !== null && $this->executable !== '') {
            array_unshift($args, $this->executable);
        }

        return $args;
    }
178938
public function getMetaData()
    {
        if (count($this->command) == 0) {
            return ['console' => [
                'Command' => 'Command could not be retrieved', ],
            ];
        }
        $commandString = implode(' ', $this->command);
        $primaryCommand = $this->command[0];
        $arguments = [];
        $options = [];
        foreach (array_slice($this->command, 1) as $arg) {
            if (isset($arg[0]) && $arg[0] === '-') {
                $options[] = $arg;
            } else {
                $arguments[] = $arg;
            }
        }
        $data = [
            'Input' => $commandString,
            'Command' => $primaryCommand,
            'Arguments' => $arguments,
            'Options' => $options,
        ];

        return ['console' => $data];
    }
854368
public function getScheduledCommands()
    {
        $scheduledCommands = [];
        foreach ($this->console->all() as $command) {
            if ($command instanceof ScheduledCommandInterface) {
                $scheduledCommands[] = $command;
            }
        }

        return $scheduledCommands;
    }
885675
public function getCommands()
    {
        $commands = $this->getModuleCommands($this->app);
        sort($commands);
        return array_unique($commands);
    }
1109415
private function registerCommands()
    {
        //scheduled:summary
        $this->app->bindShared('command.scheduled.summary', function (Application $app) {
            return $app->make('Indatus\Dispatcher\Commands\ScheduleSummary');
        });

        //scheduled:make
        $this->app->bindShared('command.scheduled.make', function (Application $app) {
            return $app->make('Indatus\Dispatcher\Commands\Make');
        });

        //scheduled:run
        $this->app->bindShared('command.scheduled.run', function (Application $app) {
            return $app->make('Indatus\Dispatcher\Commands\Run');
        });

        $this->commands($this->provides());
    }
603604
public function getAll()
    {
        $aRes = array();
        foreach ($this->getKeys() as $sKey) {
            $aRes[$sKey] = $this->get($sKey);
        }
        return $aRes;
    }
176738
protected function get_js_commands()
    {
        $out = '';

        foreach ($this->commands as $i => $args) {
            $method = array_shift($args);
            foreach ($args as $i => $arg) {
                $args[$i] = self::json_serialize($arg, $this->devel_mode, false);
            }

            $out .= sprintf(
                "this.%s(%s);\n",
                preg_replace('/^parent\./', '', $method),
                implode(',', $args)
            );
        }

        return $out;
    }
474839
protected function getCommands()
    {
        // construct command classes path depending on grp_cmd flag
        $cmdPath = rtrim(__DIR__ . "/" . $this->data['cmd_path'], '/') . '/';
        $cmdPath .= ($this->data['grp_cmd']) ? "*/*.php" : "*.php";

        // construct commad path regex depending on grp_cmd flag
        $cmdPattern = ($this->data['grp_cmd'])
            ? '/^.*\/([^\/]+)\/([^\/]+)\.php$/'
            : '/^.*\/([^\/]+)\.php$/';

        // find all command files and commands
        $commands = [];
        foreach (glob($cmdPath) as $file) {
           // match only php files, extract group dir name
            if (!preg_match($cmdPattern, $file, $matches)) {
                continue;
            }

            // construct a class name from our namespace, optional
            // command group subdir and actual class file name
            $className = __NAMESPACE__ . "\\" . str_replace("/", "\\", $this->data['cmd_path']) . $matches[1];
            $className .= ($this->data['grp_cmd']) ? "\\" . $matches[2] : "";

            // skip if class doesn't exist
            if (!class_exists($className)) {
                continue;
            }

            // add to our commands list
            $commands []= $className;
        }

        if (!empty($this->data['config']['extra_commands']) && is_array($this->data['config']['extra_commands'])) {
            $commands = array_merge($commands, $this->data['config']['extra_commands']);
        }

        return $commands;
    }
4938
protected function getDisabledCommands() {
    $disabled_commands_config = $this->getConfigValue('disable-targets');
    if ($disabled_commands_config) {
      $disabled_commands = ArrayManipulator::flattenMultidimensionalArray($disabled_commands_config, ':');
      return $disabled_commands;
    }
    return [];
  }