kitchenu / slim-debugbar
Slim 3的PHP Debugbar集成
v1.1.1
2018-07-29 16:58 UTC
Requires
- php: >=5.5.0
- maximebf/debugbar: ^1.12.0
- psr/http-message: ^1.0
- slim/slim: ^3.0
Requires (Dev)
- phpunit/phpunit: ^4.0|^5.0
README
这是一个用于将PHP Debug Bar与Slim 3集成的包。
安装
使用composer要求此包
composer require kitchenu/slim-debugbar
注册一个提供者
$app = new Slim\App();
$provider = new Kitchenu\Debugbar\ServiceProvider();
$provider->register($app);
桥接收集器
$container = $app->getContainer();
$container['pdo'] = function () {
return new PDO('sqlite::memory:');
};
$collector = new DebugBar\DataCollector\PDO\PDOCollector($container->pdo);
$container->debugbar->addCollector($collector);
阅读文档以获取更多桥接收集器信息