Changeset View
Changeset View
Standalone View
Standalone View
branches/5.3.x/core/kernel/Console/ConsoleApplication.php
<?php | <?php | ||||
/** | /** | ||||
* @version $Id$ | * @version $Id$ | ||||
* @package In-Portal | * @package In-Portal | ||||
* @copyright Copyright (C) 1997 - 2015 Intechnic. All rights reserved. | * @copyright Copyright (C) 1997 - 2015 Intechnic. All rights reserved. | ||||
* @license GNU/GPL | * @license GNU/GPL | ||||
* In-Portal is Open Source software. | * In-Portal is Open Source software. | ||||
* This means that this software may have been modified pursuant | * This means that this software may have been modified pursuant | ||||
* the GNU General Public License, and as distributed it includes | * the GNU General Public License, and as distributed it includes | ||||
* or is derivative of works licensed under the GNU General Public License | * or is derivative of works licensed under the GNU General Public License | ||||
* or other free or open source software licenses. | * or other free or open source software licenses. | ||||
* See http://www.in-portal.org/license for copyright notices and details. | * See http://www.in-portal.org/license for copyright notices and details. | ||||
*/ | */ | ||||
namespace Intechnic\InPortal\Core\kernel\Console; | namespace InPortal\Core\kernel\Console; | ||||
use Symfony\Component\Console\Application as BaseApplication; | use Symfony\Component\Console\Application as BaseApplication; | ||||
use Symfony\Component\Console\Command\Command; | use Symfony\Component\Console\Command\Command; | ||||
defined('FULL_PATH') or die('restricted access!'); | defined('FULL_PATH') or die('restricted access!'); | ||||
class ConsoleApplication extends BaseApplication | class ConsoleApplication extends BaseApplication | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
* | * | ||||
* @return Command[] An array of default Command instances | * @return Command[] An array of default Command instances | ||||
*/ | */ | ||||
protected function getDefaultCommands() | protected function getDefaultCommands() | ||||
{ | { | ||||
$default_commands = parent::getDefaultCommands(); | $default_commands = parent::getDefaultCommands(); | ||||
$command_provider_classes = $this->Application->getSubClasses( | $command_provider_classes = $this->Application->getSubClasses( | ||||
'Intechnic\InPortal\Core\kernel\Console\IConsoleCommandProvider' | 'InPortal\Core\kernel\Console\IConsoleCommandProvider' | ||||
); | ); | ||||
foreach ( $command_provider_classes as $command_provider_class ) { | foreach ( $command_provider_classes as $command_provider_class ) { | ||||
/** @var IConsoleCommandProvider $command_provider */ | /** @var IConsoleCommandProvider $command_provider */ | ||||
$command_provider = new $command_provider_class(); | $command_provider = new $command_provider_class(); | ||||
$default_commands = array_merge($default_commands, $command_provider->getConsoleCommands()); | $default_commands = array_merge($default_commands, $command_provider->getConsoleCommands()); | ||||
} | } | ||||
return $default_commands; | return $default_commands; | ||||
} | } | ||||
} | } |