Skip to content

Commit

Permalink
feature: 支持二级目录访问
Browse files Browse the repository at this point in the history
  • Loading branch information
krissss committed Jan 10, 2024
1 parent 7172990 commit f448183
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/WebmanDebugBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class WebmanDebugBar extends DebugBar
'storage' => true, // 定义 storage
'http_driver' => true, // 定义 http_driver
'open_handler_url' => '/_debugbar/open', // storage 启用时打开历史的路由
'open_handler_url_make' => null, // 构建用于访问的 open_handler 的 url 地址,callable 类型,用于二级目录访问的场景
'asset_base_url' => '/_debugbar/assets', // 静态资源的路由
'sample_url' => '/_debugbar/sample', // 示例页面,可用于查看 debugbar 信息,设为 null 关闭
'javascript_renderer_options' => [], // 其他 javascriptRenderer 参数
Expand Down Expand Up @@ -255,7 +256,11 @@ protected function bootJavascriptRenderer(): void
$renderer = $this->getJavascriptRenderer($this->config['asset_base_url']);
// 历史访问
if ($this->getStorage() && $this->config['open_handler_url']) {
$renderer->setOpenHandlerUrl($this->config['open_handler_url']);
$url = $this->config['open_handler_url'];
if (is_callable($this->config['open_handler_url_make'])) {
$url = call_user_func($this->config['open_handler_url_make'], $url);
}
$renderer->setOpenHandlerUrl($url);
}
// 其他配置参数
$renderer->setOptions($this->config['javascript_renderer_options']);
Expand Down

0 comments on commit f448183

Please sign in to comment.