mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 07:02:47 +08:00
优化代码规范
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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])) {
|
||||
|
||||
Reference in New Issue
Block a user