tacone/silex-propel-web-profiler

Extending Silex WebProfiler with Propel information

0.1.1 2013-05-22 19:41 UTC

This package is not auto-updated.

Last update: 2024-11-04 13:46:41 UTC


README

A Silex Service Provider that lists the DB queries generated by Propel 1.6.x in the Silex Web Profiler in pretty much the same way the Symfony Profiler does in Symfony Standard Edition.

Installation

Add it to your composer.json:

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

Update composer:

php composer.phar update

Then register it after Propel and the Silex Web Profiler:

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

Point your browser to /index_dev.php and you should see Propel in your debug bar.

Sample registration of all of them:

$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());
}

Notes:

Despite doing my best I could not understand how to fully extract the Propel configuration. Because of that, many ? will show in the configuration section of the Propel panel. That's perfectly fine. If you know how to get the data, feel free to send me a Pull Request.

Also note that using the Web Profiler makes Silex very slow.

For the lazy

I mantain a fork of the popular Silex Kitchen Sink Edition, with Propel and the Profiler pre-installed here.