tacone/silex-propel-web-profiler

扩展 Silex WebProfiler 以包含 Propel 信息

0.1.1 2013-05-22 19:41 UTC

This package is not auto-updated.

Last update: 2024-09-23 13:20:31 UTC


README

一个 Silex 服务提供者,它将 Propel 1.6.xSilex Web Profiler 中生成的数据库查询列出来,几乎与 Symfony ProfilerSymfony 标准版 中做的一样。

安装

将其添加到您的 composer.json

require "tacone/silex-propel-web-profiler": "0.*"

更新 composer

php composer.phar update

然后注册它 在 Propel 和 Silex Web Profiler 之后

$app->register(new PropelWebProfilerServiceProvider());

将浏览器指向 /index_dev.php,你应该会在调试栏中看到 Propel。

所有这些的示例注册

$app->register(new Propel\Silex\PropelServiceProvider(), array(
    'propel.config_file' => __DIR__ . '/../resources/generated/propel-config/propel-conf.php',
    'propel.model_path' => __DIR__ . '/',
));

if ($app['debug'] && isset($app['cache.path'])) {
    $app->register(new ServiceControllerServiceProvider());
    $app->register(new WebProfilerServiceProvider(), array(
        'profiler.cache_dir' => $app['cache.path'].'/profiler',
    ));
    
    $app->register(new PropelWebProfilerServiceProvider());
}

注意

尽管我已经尽力,但我无法完全理解如何提取 Propel 配置。因此,在 Propel 面板的配置部分将显示许多 ?。这是完全可以接受的。如果你知道如何获取数据,请随意发送给我一个 Pull Request。

请注意,使用 Web Profiler 会使 Silex 非常慢。

对于懒惰的人

我维护了一个 Silex Kitchen Sink Edition 的分支,其中预装了 Propel 和 Profiler,你可以在这里找到它 这里