protected function registerCommands()
{
$this->app->boot();
$config = $this->app->getConfig();
$commands = array(new Command\AssetsInstallCommand(), new Command\CacheClearCommand(), new Command\ConfigDebugCommand(), new Command\ModuleDebugCommand(), new Command\RouterDebugCommand(), new Command\RouterMatchCommand(), new Command\ServiceManagerDebugCommand());
if (isset($config['module_listener_options']['module_paths'][0], $config['framework']['skeleton_module']['path'])) {
$moduleCreateCommand = new Command\ModuleCreateCommand();
$moduleCreateCommand->setSkeletonModuleDir($config['framework']['skeleton_module']['path']);
$moduleCreateCommand->setTargetModuleDir($config['module_listener_options']['module_paths'][0]);
// Enabled templating engines
if (isset($config['framework']['templating']['engines'])) {
$moduleCreateCommand->setEnabledTemplatingEngines($config['framework']['templating']['engines']);
}
$commands[] = $moduleCreateCommand;
}
$this->addCommands($commands);
// Commands found in active Modules
foreach ($this->app->getModules() as $module) {
if ($module instanceof AbstractModule) {
$module->registerCommands($this);
}
}
}