From 2d225b0f80197860d70bba2725b41db6a57cb3a0 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 24 Apr 2017 15:04:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E7=94=A8=E5=91=BD=E5=90=8D=E7=A9=BA?= =?UTF-8?q?=E9=97=B4=E5=8F=96=E6=B6=88=E9=85=8D=E7=BD=AE=20=E4=BE=BF?= =?UTF-8?q?=E4=BA=8E=E5=9C=A8=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E5=BA=94=E7=94=A8=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- convention.php | 2 -- library/think/App.php | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/convention.php b/convention.php index 887b076d..c22a7bac 100644 --- a/convention.php +++ b/convention.php @@ -5,8 +5,6 @@ return [ // | 应用设置 // +---------------------------------------------------------------------- - // 应用命名空间 - 'app_namespace' => 'app', // 应用调试模式 'app_debug' => true, // 应用Trace diff --git a/library/think/App.php b/library/think/App.php index 531bc7c4..35c5c86c 100644 --- a/library/think/App.php +++ b/library/think/App.php @@ -414,6 +414,9 @@ class App public static function initCommon() { if (empty(self::$init)) { + // 注册应用命名空间 + Loader::addNamespace(self::$namespace, APP_PATH); + // 初始化应用 $config = self::init(); self::$suffix = $config['class_suffix']; @@ -433,9 +436,6 @@ class App } } - // 注册应用命名空间 - self::$namespace = $config['app_namespace']; - Loader::addNamespace($config['app_namespace'], APP_PATH); if (!empty($config['root_namespace'])) { Loader::addNamespace($config['root_namespace']); }