1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
-
-
- namespace Doctrine\DBAL\Logging;
-
-
- class DebugStack implements SQLLogger
- {
-
- public $queries = array();
-
-
- public $enabled = true;
-
- public $start = null;
-
- public $currentQuery = 0;
-
-
-
- public function startQuery($sql, array $params = null, array $types = null)
- {
- if ($this->enabled) {
- $this->start = microtime(true);
- $this->queries[++$this->currentQuery] = array('sql' => $sql, 'params' => $params, 'types' => $types, 'executionMS' => 0);
- }
- }
-
-
-
- public function stopQuery()
- {
- $this->queries[$this->currentQuery]['executionMS'] = microtime(true) - $this->start;
- }
- }
-
|