Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tacone/silex-propel-webprofiler

Extending the Silex-WebProfiler to display Propel queries
https://github.com/tacone/silex-propel-webprofiler

Last synced: 7 days ago
JSON representation

Extending the Silex-WebProfiler to display Propel queries

Awesome Lists containing this project

README

        

Silex-Propel-WebProfiler
========================

A Silex Service Provider that lists the DB queries generated by [Propel 1.6.x](http://propelorm.org/ ) in the [Silex Web Profiler](https://github.com/sensiolabs/Silex-WebProfiler) in pretty much the same way the *Symfony Profiler* does in *Symfony Standard Edition*.

## Installation

Add it to your `composer.json`:

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

Update composer:

```bash
php composer.phar update
```

Then register it **after Propel and the Silex Web Profiler**:

```php
$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:
```php
$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](https://github.com/tacone/Silex-Propel-WebProfiler).