This commit is contained in:
Alexander Makarov
2013-09-10 20:02:09 +04:00
parent e3e6518cf1
commit 5a6357255b
2 changed files with 26 additions and 5 deletions

View File

@@ -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