Application =& \kApplication::Instance(); $this->Conn =& $this->Application->GetADODBConnection(); parent::__construct( 'In-Portal CLI', $this->Application->ModuleInfo['Core']['Version'] . ' (PHP v' . phpversion() . ')' ); } /** * Returns Kernel Application instance. * * @return \kApplication */ public function getKernelApplication() { return $this->Application; } /** * Gets the default commands that should always be available. * * @return Command[] An array of default Command instances */ protected function getDefaultCommands() { $default_commands = parent::getDefaultCommands(); $command_provider_classes = $this->Application->getSubClasses( 'Intechnic\InPortal\Core\kernel\Console\IConsoleCommandProvider' ); foreach ( $command_provider_classes as $command_provider_class ) { /** @var IConsoleCommandProvider $command_provider */ $command_provider = new $command_provider_class(); $default_commands = array_merge($default_commands, $command_provider->getConsoleCommands()); } return $default_commands; } }