diff --git a/cake/libs/view/elements/sql_dump.ctp b/cake/libs/view/elements/sql_dump.ctp index 033fa30da..c5cea554c 100644 --- a/cake/libs/view/elements/sql_dump.ctp +++ b/cake/libs/view/elements/sql_dump.ctp @@ -20,9 +20,9 @@ if (!class_exists('ConnectionManager') || Configure::read('debug') < 2) { return false; } - -$sources = ConnectionManager::sourceList(); if (!isset($logs)): + $sources = ConnectionManager::sourceList(); + $logs = array(); foreach ($sources as $source): $db =& ConnectionManager::getDataSource($source); @@ -31,24 +31,27 @@ if (!isset($logs)): endif; $logs[$source] = $db->getLog(); endforeach; -endif; -foreach ($logs as $source => $logInfo): - $text = $logInfo['count'] > 1 ? 'queries' : 'query'; - printf( - '
Nr | Query | Error | Affected | Num. rows | Took (ms) |
---|---|---|---|---|---|
" . ($k + 1) . " | " . h($i['query']) . " | {$i['error']} | {$i['affected']} | {$i['numRows']} | {$i['took']} |