pana1990/php-web-profiler
最新稳定版本:v0.3.2-alpha
Composer 安装命令:
composer require pana1990/php-web-profiler
包简介
Web profiler in the browser for php application
README 文档
README
This package is under development. Please do not use in production yet 🙏
TODO
Getting Started
$ composer require --dev pana1990/php-web-profiler
Example usage with slim framework:
require __DIR__ . '/vendor/autoload.php'; $app = AppFactory::create(); // services Db::setUp(); // setup schema $pdoTraceable = new PdoTraceable('sqlite:' . __DIR__ . '/src/db/bbdd.db'); $log = (new Logger('log'))->pushHandler(new ErrorLogHandler()); $traceableLogger = new LoggerTraceable($log); // setup for PhpWebProfiler SlimPhpWebProfilerBuilder::fromApp($app) ->withPdo($pdoTraceable) ->withLogger($traceableLogger) ->build(); $app->get('/', function (Request $request, Response $response) use ($traceableLogger, $pdoTraceable) { $response->getBody()->write('Hello world!'); $traceableLogger->error('This is an error message'); $pdoTraceable->exec('INSERT INTO test (title) VALUES ("test");'); $pdoTraceable->exec('SELECT * FROM test;'); return $response; }); $app->run();
See full example in here.
Note: with this setup you have two endpoints enabled (
debuganddebug/:token)
📷 Screenshots
Index page
Request panel
Log panel
Database panel
📅 ROADMAP
[ ] Add support for slim
⚖️ LICENSE
php-web-profiler is released under the MIT License. See the bundled LICENSE for details.
统计信息
- 总下载量: 1.31k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-29



