修正classmap中遗漏think\debug\Trace的路径 (#179)

* 修正classmap中遗漏think\debug\trace\Html和think\debug\trace\Console的路径

* 修正classmap中遗漏think\debug\Trace的路径

* 判断trace类型类是否存在
This commit is contained in:
CantonBolo
2016-06-30 11:44:59 +08:00
committed by 云无心
parent 2a7f46af00
commit 12081bb1e3
2 changed files with 9 additions and 1 deletions

View File

@@ -56,6 +56,9 @@ return [
'think\db\builder\Sqlsrv' => CORE_PATH . 'db' . DS . 'builder' . DS . 'Sqlsrv' . EXT,
'think\db\Query' => CORE_PATH . 'db' . DS . 'Query' . EXT,
'think\Debug' => CORE_PATH . 'Debug' . EXT,
'think\debug\Trace' => CORE_PATH . 'debug' . DS . 'Trace' . EXT,
'think\debug\trace\Html' => CORE_PATH . 'debug' . DS . 'trace' . DS . 'Html' . EXT,
'think\debug\trace\Console' => CORE_PATH . 'debug' . DS . 'trace' . DS . 'Console' . EXT,
'think\Error' => CORE_PATH . 'Error' . EXT,
'think\Exception' => CORE_PATH . 'Exception' . EXT,
'think\exception\ClassNotFoundException' => CORE_PATH . 'exception' . DS . 'ClassNotFoundException' . EXT,

View File

@@ -11,6 +11,7 @@
namespace think\debug;
use think\Config;
use think\exception\ClassNotFoundException;
use think\Log;
use think\Request;
use think\Response;
@@ -31,7 +32,11 @@ class Trace
$class = false !== strpos($type, '\\') ? $type : '\\think\\debug\\trace\\' . ucwords($type);
unset($config['type']);
$trace = new $class($config);
if(class_exists($class)) {
$trace = new $class($config);
} else {
throw new ClassNotFoundException('class not exists:' . $class, $class);
}
if ($response instanceof Redirect) {
//TODO 记录