mirror of
https://github.com/yiisoft/yii.git
synced 2026-03-03 23:04:04 +01:00
merge from 1.0.
This commit is contained in:
@@ -20,10 +20,12 @@
|
||||
class ModuleCommand extends CConsoleCommand
|
||||
{
|
||||
/**
|
||||
* @var string the template file for the controller class.
|
||||
* Defaults to null, meaning using 'framework/cli/views/shell/controller/controller.php'.
|
||||
* @var string the directory that contains templates for the module command.
|
||||
* Defaults to null, meaning using 'framework/cli/views/shell/module'.
|
||||
* If you set this path and some views are missing in the directory,
|
||||
* the default views will be used.
|
||||
*/
|
||||
public $templateFile;
|
||||
public $templatePath;
|
||||
|
||||
public function getHelp()
|
||||
{
|
||||
@@ -57,9 +59,7 @@ EOD;
|
||||
$moduleClass=ucfirst($moduleID).'Module';
|
||||
$modulePath=Yii::app()->getModulePath().DIRECTORY_SEPARATOR.$moduleID;
|
||||
|
||||
$sourceDir=realpath(dirname(__FILE__).'/../../views/shell/module');
|
||||
if($sourceDir===false)
|
||||
die('Unable to locate the source directory.');
|
||||
$sourceDir=$this->templatePath===null?YII_PATH.'/cli/views/shell/module':$this->templatePath;
|
||||
$list=$this->buildFileList($sourceDir,$modulePath);
|
||||
$list['module.php']['target']=$modulePath.DIRECTORY_SEPARATOR.$moduleClass.'.php';
|
||||
$list['module.php']['callback']=array($this,'generateModuleClass');
|
||||
|
||||
Reference in New Issue
Block a user