dev-master
9999999-devSymfony DoctrineBundle extension with a Stacktrace per Query
MIT
The Requires
Symfony DoctrineBundle extension with a Stacktrace per Query
Symfony DoctrineBundle extension with a Stacktrace per Query, (*1)
"terwey/doctrine-stack-bundle": "dev-master"
if (in_array($this->getEnvironment(), array('dev', 'test'))) { $bundles[] = new Terwey\DoctrineStackBundle\DoctrineStackBundle(); }
I currently can't figure out how to get it to properly work from a Bundle so you'll have to replace this file locally: vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/DebugStack.php
, (*2)
Change this line:, (*3)
$this->queries[++$this->currentQuery] = array('sql' => $sql, 'params' => $params, 'types' => $types, 'executionMS' => 0);
To this line:, (*4)
$e = new \Exception; $shortTrace = explode("\n", $e->getTraceAsString())[5]; $this->queries[++$this->currentQuery] = array('sql' => $sql, 'params' => $params, 'types' => $types, 'executionMS' => 0, 'stacktrace' => $e->getTraceAsString(), 'shortstack' => $shortTrace);
If you happen to know how to do this properly, please make a PR!, (*5)
Symfony DoctrineBundle extension with a Stacktrace per Query
MIT