src/mako/application/cli/Application.php
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;
	}
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;
	}
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 ; }
Returns all registered commands.

@return array
Returns all registered commands .