mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-09-02 21:41:36 +08:00
驱动设计支持使用 namespace配置改变默认命名空间位置
This commit is contained in:
@@ -13,8 +13,8 @@ namespace think;
|
||||
|
||||
class Cache
|
||||
{
|
||||
public static $readTimes = 0;
|
||||
public static $writeTimes = 0;
|
||||
public static $readTimes = 0;
|
||||
public static $writeTimes = 0;
|
||||
|
||||
/**
|
||||
* 操作句柄
|
||||
@@ -31,8 +31,9 @@ class Cache
|
||||
*/
|
||||
public static function connect($options = [])
|
||||
{
|
||||
$type = !empty($options['type']) ? $options['type'] : 'File';
|
||||
$class = '\\think\\cache\\driver\\' . ucwords($type);
|
||||
$type = !empty($options['type']) ? $options['type'] : 'File';
|
||||
$class = (!empty($options['namespace']) ? $options['namespace'] : '\\think\\cache\\driver\\') . ucwords($type);
|
||||
unset($options['type']);
|
||||
self::$handler = new $class($options);
|
||||
return self::$handler;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user