取消APP_NAMESPACE常量定义 改为 App::$namespace 调整Build类的module和run方法 增加namespace参数

This commit is contained in:
thinkphp
2016-06-15 22:42:49 +08:00
parent fe8f51dd68
commit 2aa3e4fa5b
9 changed files with 33 additions and 22 deletions

View File

@@ -11,6 +11,7 @@
namespace think\console\command\make;
use think\App;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
@@ -39,7 +40,7 @@ class Controller extends \think\console\command\Make
// 处理命名空间
if (!empty($module)) {
$namespace = APP_NAMESPACE . "\\" . $module . "\\" . 'controller' . "\\" . $namespace;
$namespace = App::$namespace . "\\" . $module . "\\" . 'controller' . "\\" . $namespace;
}
// 处理继承
@@ -50,7 +51,7 @@ class Controller extends \think\console\command\Make
} else {
if (!preg_match("/\\\/", $extend)) {
if (!empty($module)) {
$extend = "\\" . APP_NAMESPACE . "\\" . $module . "\\" . 'controller' . "\\" . $extend;
$extend = "\\" . App::$namespace . "\\" . $module . "\\" . 'controller' . "\\" . $extend;
}
}
}