Last active
July 14, 2016 17:11
-
-
Save rodmcnew/6f9094b6e27318042a0dc22c1a54dc5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Paste this code at the top of \Doctrine\DBAL\Connection:executeQuery() | |
*/ | |
$startTime = microtime(true); | |
//Body of \Doctrine\DBAL\Connection:executeQuery() goes here | |
/** | |
* Paste this code at the bottom of \Doctrine\DBAL\Connection:executeQuery() | |
*/ | |
if (!isset($GLOBALS['doctrineLogQueryCount'])) { | |
$GLOBALS['doctrineLogQueryCount'] = 0; | |
} | |
$GLOBALS['doctrineLogQueryCount']++; | |
echo 'Query #' . $GLOBALS['doctrineLogQueryCount'] . ' [' | |
. round((microtime(true) - $startTime) * 1000) . 'ms]' | |
. '<br>' . $query . '<hr>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment