|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Daken\ReleaseProfilerBundle; |
|
4
|
|
|
|
|
5
|
|
|
use Symfony\Component\HttpKernel\Bundle\Bundle; |
|
6
|
|
|
|
|
7
|
|
|
class DakenReleaseProfilerBundle extends Bundle |
|
8
|
|
|
{ |
|
9
|
1 |
|
public function boot() |
|
10
|
|
|
{ |
|
11
|
1 |
|
parent::boot(); |
|
12
|
|
|
|
|
13
|
1 |
|
$doctrineConfig = $this->container->get('doctrine') |
|
14
|
1 |
|
->getConnection() |
|
15
|
1 |
|
->getConfiguration(); |
|
16
|
|
|
|
|
17
|
1 |
|
if (php_sapi_name() != 'cli' || $this->container->hasParameter('daken_release_profiler.force_sql_logger')) { |
|
18
|
1 |
|
$logger = $this->container->get('daken_release_profiler.sql_logger'); |
|
19
|
1 |
|
$logger->setOldLogger($doctrineConfig->getSQLLogger()); |
|
20
|
1 |
|
$doctrineConfig->setSQLLogger($logger); |
|
21
|
1 |
|
} |
|
22
|
1 |
|
} |
|
23
|
|
|
} |
|
24
|
|
|
|