mirror of
https://github.com/yiisoft/yii.git
synced 2026-03-22 16:06:53 +01:00
fixes #2852
This commit is contained in:
@@ -104,11 +104,8 @@ EOD;
|
||||
// disable E_NOTICE so that the shell is more friendly
|
||||
error_reporting(E_ALL ^ E_NOTICE);
|
||||
|
||||
$_runner_=new CConsoleCommandRunner;
|
||||
$_runner_->addCommands(dirname(__FILE__).'/shell');
|
||||
$_runner_->addCommands(Yii::getPathOfAlias('application.commands.shell'));
|
||||
if(($_path_=@getenv('YIIC_SHELL_COMMAND_PATH'))!==false)
|
||||
$_runner_->addCommands($_path_);
|
||||
$_runner_=$this->createCommandRunner();
|
||||
$this->addCommands($_runner_);
|
||||
$_commands_=$_runner_->commands;
|
||||
$log=Yii::app()->log;
|
||||
|
||||
@@ -139,6 +136,29 @@ EOD;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a commands runner
|
||||
* @return CConsoleCommandRunner
|
||||
* @since 1.1.15
|
||||
*/
|
||||
protected function createCommandRunner()
|
||||
{
|
||||
return new CConsoleCommandRunner;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds commands to runner
|
||||
* @param CConsoleCommandRunner $runner
|
||||
* @since 1.1.15
|
||||
*/
|
||||
protected function addCommands(CConsoleCommandRunner $runner)
|
||||
{
|
||||
$runner->addCommands(Yii::getPathOfAlias('system.cli.commands.shell'));
|
||||
$runner->addCommands(Yii::getPathOfAlias('application.commands.shell'));
|
||||
if(($_path_=@getenv('YIIC_SHELL_COMMAND_PATH'))!==false)
|
||||
$runner->addCommands($_path_);
|
||||
}
|
||||
}
|
||||
|
||||
class ShellException extends CException
|
||||
|
||||
Reference in New Issue
Block a user