改进App类 修正单元测试

This commit is contained in:
thinkphp
2016-05-11 12:45:06 +08:00
parent 79c381353d
commit 03b87a9eb0
4 changed files with 38 additions and 33 deletions

View File

@@ -105,10 +105,14 @@ class App
}
// 输出数据到客户端
if (isset($data)) {
// 监听app_end
APP_HOOK && Hook::listen('app_end', $data);
// 自动响应输出
return Response::send($data, '', Config::get('response_return'));
if ($data instanceof Response) {
return $data->send();
} else {
// 监听app_end
APP_HOOK && Hook::listen('app_end', $data);
// 自动响应输出
return Response::send($data, '', Config::get('response_return'));
}
}
}