Skip to content

Commit

Permalink
Merge pull request #24 from stood/profiler_sf3
Browse files Browse the repository at this point in the history
remove dependency for pomm
  • Loading branch information
chanmix51 committed Apr 11, 2016
2 parents 5ad7902 + a6bbd4d commit f168161
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions sources/lib/DatabaseDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use PommProject\Foundation\Exception\SqlException;
use PommProject\Foundation\Listener\Listener;
use PommProject\Foundation\Session\Session;
use PommProject\Foundation\Pomm;

use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Component\HttpFoundation\Request;
Expand All @@ -35,25 +34,18 @@ class DatabaseDataCollector extends DataCollector
/** @var Stopwatch */
private $stopwatch;

public function __construct(Pomm $pomm, Stopwatch $stopwatch = null)
public function __construct($unused = null, Stopwatch $stopwatch = null)
{
if ($unused !== null) {
trigger_error("The parameter Pomm has been deleted for to delete the high dependency.", E_USER_DEPRECATED);
}

$this->stopwatch = $stopwatch;
$this->data = [
'time' => 0,
'queries' => [],
'exception' => null,
];

$callable = [$this, 'execute'];

foreach ($pomm->getSessionBuilders() as $name => $builder) {
$pomm->addPostConfiguration($name, function($session) use ($callable) {
$session
->getClientUsingPooler('listener', 'query')
->attachAction($callable)
;
});
}
}

/**
Expand Down

0 comments on commit f168161

Please sign in to comment.