Total Complexity | 4 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | abstract class DefaultCommand extends ContainerAwareCommand |
||
9 | { |
||
10 | private $sglLoggerEnabled = false; |
||
11 | private $stack = null; |
||
12 | |||
13 | /** |
||
14 | * @param $input |
||
15 | */ |
||
16 | protected function init($input) |
||
17 | { |
||
18 | if ($input->getOption('debug')) { |
||
19 | $this->sglLoggerEnabled = true; |
||
20 | // Start setup logger |
||
21 | $doctrine = $this->getContainer()->get('doctrine'); |
||
22 | $doctrineConnection = $doctrine->getConnection(); |
||
23 | $this->stack = new DebugStack(); |
||
24 | $doctrineConnection->getConfiguration()->setSQLLogger($this->stack); |
||
25 | // End setup logger |
||
26 | } |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * @param $output |
||
31 | */ |
||
32 | protected function end($output) |
||
36 | } |
||
37 | } |
||
39 |