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( - '', - preg_replace('/[^A-Za-z0-9_]/', '_', uniqid(time(), true)) - ); - printf('', $source, $logInfo['count'], $text, $logInfo['time']); + + foreach ($logs as $source => $logInfo): + $text = $logInfo['count'] > 1 ? 'queries' : 'query'; + printf( + '
(%s) %s %s took %s ms
', + preg_replace('/[^A-Za-z0-9_]/', '_', uniqid(time(), true)) + ); + printf('', $source, $logInfo['count'], $text, $logInfo['time']); + ?> + + + + + $i) : + echo "\n"; + endforeach; + ?> +
(%s) %s %s took %s ms
NrQueryErrorAffectedNum. rowsTook (ms)
" . ($k + 1) . "" . h($i['query']) . "{$i['error']}{$i['affected']}{$i['numRows']}{$i['took']}
+ - - NrQueryErrorAffectedNum. rowsTook (ms) - - - $i) : - echo "" . ($k + 1) . "" . h($i['query']) . "{$i['error']}{$i['affected']}{$i['numRows']}{$i['took']}\n"; - endforeach; -?> - -