enabled && MemoryUtility::isMemoryConsumptionTooHigh()) { $this->enabled = false; $this->logger->warning('SQL Logging consumed too much memory, aborted. Not all queries have been recorded.'); } if ($this->enabled) { $this->start = microtime(true); $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 7); // remove this method array_shift($backtrace); // remove doctrine execute query array_shift($backtrace); // remove queryBuilder execute array_shift($backtrace); $this->queries[++$this->currentQuery] = [ 'sql' => $sql, 'params' => $params, 'types' => $types, 'executionMS' => 0, 'backtrace' => $backtrace ]; } } /** * {@inheritdoc} */ public function stopQuery() { if ($this->enabled) { $this->queries[$this->currentQuery]['executionMS'] = microtime(true) - $this->start; } } /** * @return array */ public function getQueries(): array { return $this->queries; } }