mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 07:02:47 +08:00
改进驱动命名空间检测
This commit is contained in:
@@ -42,7 +42,7 @@ class Log
|
||||
public static function init($config = [])
|
||||
{
|
||||
$type = isset($config['type']) ? $config['type'] : 'File';
|
||||
$class = strpos($type, '\\') ? $type : '\\think\\log\\driver\\' . ucwords($type);
|
||||
$class = false !== strpos($type, '\\') ? $type : '\\think\\log\\driver\\' . ucwords($type);
|
||||
self::$config = $config;
|
||||
unset($config['type']);
|
||||
self::$driver = new $class($config);
|
||||
@@ -57,7 +57,7 @@ class Log
|
||||
public static function alarm($config = [])
|
||||
{
|
||||
$type = isset($config['type']) ? $config['type'] : 'Email';
|
||||
$class = strpos($type, '\\') ? $type : '\\think\\log\\alarm\\' . ucwords($type);
|
||||
$class = false !== strpos($type, '\\') ? $type : '\\think\\log\\alarm\\' . ucwords($type);
|
||||
unset($config['type']);
|
||||
self::$alarm = new $class($config['alarm']);
|
||||
// 记录初始化信息
|
||||
|
||||
Reference in New Issue
Block a user