mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-03 05:52:48 +08:00
debug类
This commit is contained in:
@@ -17,6 +17,27 @@ class Debug
|
||||
protected static $info = [];
|
||||
protected static $mem = [];
|
||||
|
||||
/**
|
||||
* 操作句柄
|
||||
* @var object
|
||||
* @access protected
|
||||
*/
|
||||
protected static $handler = null;
|
||||
|
||||
/**
|
||||
* 初始化调试驱动
|
||||
* @access public
|
||||
* @param array $options 配置数组
|
||||
* @return object
|
||||
*/
|
||||
public static function init($options = [])
|
||||
{
|
||||
$type = !empty($options['type']) ? $options['type'] : 'Local';
|
||||
$class = 'think\\debug\\driver\\' . ucwords($type);
|
||||
self::$handler = new $class($options);
|
||||
return self::$handler;
|
||||
}
|
||||
|
||||
/**
|
||||
* 记录时间(微秒)和内存使用情况
|
||||
* @param string $name 标记位置
|
||||
@@ -121,4 +142,10 @@ class Debug
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
// 静态调用
|
||||
public static function __callStatic($method, $params)
|
||||
{
|
||||
return call_user_func_array([self::$handler, $method], $params);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user