roxblnfk / yiigregator
Yii的Buggregator集成
dev-master
2024-06-13 17:26 UTC
Requires
- php: >=8.1
- psr/http-server-middleware: ^1.0
- spiral-packages/profiler: ^1.2
Requires (Dev)
- buggregator/trap: ^1.9
This package is auto-updated.
Last update: 2024-09-13 18:00:54 UTC
README
为Buggregator与Yii集成的包。
安装
使用composer安装包
composer require roxblnfk/yiigregator
如果您使用Yii的composer-config-plugin
,则可能只通过环境变量配置包。
使用方法
性能分析
- 将
Roxblnfk\Yiigregator\Middleware\ProfilerMiddleware
中间件添加到中间件列表的顶部(可能在$params['middlewares']
中)。 - 开启性能分析并使用环境变量设置Buggregator端点
PROFILER_ENABLED=true PROFILER_ENDPOINT=http://127.0.0.1:8000/api/profiler/store
注意
http://127.0.0.1:8000/api/profiler/store
是Buggregator端点的默认值。
注意
根据您的环境,您可能需要将PROFILER_ENDPOINT
设置为不同的值。例如,如果您使用Docker,您可能需要将其设置为http://buggregator:8000/api/profiler/store
。
默认情况下,使用XHProf进行性能分析。请确保它已安装并已在您的PHP配置中启用。
许可证
Yiigregator是开源软件,根据BSD-3许可证授权。