Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1949673
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Oct 29, 7:07 AM
Size
2 KB
Mime Type
text/x-diff
Expires
Sat, Oct 31, 7:07 AM (9 h, 26 m)
Engine
blob
Format
Raw Data
Handle
963502
Attached To
rINP In-Portal
in-portal
View Options
Index: branches/5.3.x/core/kernel/Console/ConsoleApplication.php
===================================================================
--- branches/5.3.x/core/kernel/Console/ConsoleApplication.php (revision 16876)
+++ branches/5.3.x/core/kernel/Console/ConsoleApplication.php (revision 16877)
@@ -1,89 +1,91 @@
<?php
/**
* @version $Id$
* @package In-Portal
* @copyright Copyright (C) 1997 - 2015 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
namespace InPortal\Core\kernel\Console;
use Symfony\Component\Console\Application as BaseApplication;
use Symfony\Component\Console\Command\Command;
defined('FULL_PATH') or die('restricted access!');
class ConsoleApplication extends BaseApplication
{
/**
* Reference to global kApplication instance.
*
* @var \kApplication
*/
protected $Application = null;
/**
* Connection to database
*
* @var \IDBConnection
*/
protected $Conn = null;
/**
* Constructor.
*
* @param string $name The name of the application.
* @param string $version The version of the application.
*/
public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN')
{
$this->Application =& \kApplication::Instance();
$this->Conn =& $this->Application->GetADODBConnection();
+ $this->setCatchExceptions(false); // The "kLogger" class will log/display exceptions.
+
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(
'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;
}
}
Event Timeline
Log In to Comment