From 491e33af8f6e3edef2efe51bdd5df917931c7b32 Mon Sep 17 00:00:00 2001 From: huangdijia Date: Fri, 4 Dec 2015 22:44:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E8=A7=84?= =?UTF-8?q?=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/config.php | 2 +- library/think/db.php | 2 +- library/think/loader.php | 4 ++-- mode/common.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library/think/config.php b/library/think/config.php index 31cfff5c..b7c45b14 100644 --- a/library/think/config.php +++ b/library/think/config.php @@ -30,7 +30,7 @@ class Config if (empty($type)) { $type = substr(strrchr($config, '.'), 1); } - $class = '\\think\\config\driver\\' . strtolower($type); + $class = '\\think\\config\\driver\\' . strtolower($type); self::set((new $class())->parse($config), '', $range); } diff --git a/library/think/db.php b/library/think/db.php index e2f7dbd1..2ae2a682 100644 --- a/library/think/db.php +++ b/library/think/db.php @@ -36,7 +36,7 @@ class Db // 解析连接参数 支持数组和字符串 $options = self::parseConfig($config); // 如果采用lite方式 仅支持原生SQL 包括query和execute方法 - $class = $lite ? 'think\db\lite' : 'think\\db\\driver\\' . strtolower($options['type']); + $class = $lite ? 'think\\db\\lite' : 'think\\db\\driver\\' . strtolower($options['type']); self::$instance[$md5] = new $class($options); } self::$_instance = self::$instance[$md5]; diff --git a/library/think/loader.php b/library/think/loader.php index e2525512..89664edf 100644 --- a/library/think/loader.php +++ b/library/think/loader.php @@ -63,7 +63,7 @@ class Loader // 注册自动加载机制 public static function register($autoload = '') { - spl_autoload_register($autoload ? $autoload : ['think\loader', 'autoload']); + spl_autoload_register($autoload ? $autoload : ['think\\loader', 'autoload']); } /** @@ -124,7 +124,7 @@ class Loader if (strpos($name, ':')) { list($class, $name) = explode(':', $name); } else { - $class = 'think\model'; + $class = 'think\\model'; } $guid = $name . '_' . $class; if (!isset($_model[$guid])) { diff --git a/mode/common.php b/mode/common.php index 49b41121..3d34c52b 100644 --- a/mode/common.php +++ b/mode/common.php @@ -29,8 +29,8 @@ return [ 'think\Db' => CORE_PATH . 'db' . EXT, 'think\Db\Driver' => CORE_PATH . 'db/driver' . EXT, 'think\Template' => CORE_PATH . 'template' . EXT, - 'think\view\driver\Think' => CORE_PATH . 'view\driver\think' . EXT, - 'think\template\driver\File' => CORE_PATH . 'template\driver\file' . EXT, + 'think\view\driver\Think' => CORE_PATH . 'view/driver/think' . EXT, + 'think\template\driver\File' => CORE_PATH . 'template/driver/file' . EXT, 'think\Error' => CORE_PATH . 'error' . EXT, 'think\Cache' => CORE_PATH . 'cache' . EXT, 'think\cache\driver\File' => CORE_PATH . 'cache/driver/file' . EXT,