kitchenu/slim-debugbar

Slim 3的PHP Debugbar集成

v1.1.1 2018-07-29 16:58 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:53:12 UTC


README

Build Status Packagist License

这是一个用于将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);

阅读文档以获取更多桥接收集器信息