vendor/topthink/think-trace/src/Html.php
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
declare (strict_types = 1);
namespace think\trace;
use think\App;
use think\Response;
/**
* 页面Trace调试
*/
class Html
{
protected $config = [
'file' => '',
'tabs' => ['base' => '基本', 'file' => '文件', 'info' => '流程', 'notice|error' => '错误', 'sql' => 'SQL', 'debug|log' => '调试'],
];
// 实例化并传入参数
public function __construct(array $config = [])
{
$this->config = array_merge($this->config, $config);
}
/**
* 调试输出接口
* @access public
* @param App $app 应用实例
* @param Response $response Response对象
* @param array $log 日志信息
* @return bool|string
*/
public function output(App $app, Response $response, array $log = [])
{
$request = $app->request;
$contentType = $response->getHeader('Content-Type');
if ($request->isJson() || $request->isAjax()) {
return false;
} elseif (!empty($contentType) && strpos($contentType, 'html') === false) {
return false;
} elseif ($response->getCode() == 204) {
return false;
}
// 获取基本信息
$runtime = number_format(microtime(true) - $app->getBeginTime(), 10, '.', '');
$reqs = $runtime > 0 ? number_format(1 / $runtime, 2) : '∞';
$mem = number_format((memory_get_usage() - $app->getBeginMem()) / 1024, 2);
// 页面Trace信息
if ($request->host()) {
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
