resolve unnecessary naming conflict in SQL dump output

This commit is contained in:
euromark 2013-05-06 12:18:01 +02:00
parent a10275fb8b
commit 4c4fdc6f70

View file

@ -20,22 +20,22 @@
if (!class_exists('ConnectionManager') || Configure::read('debug') < 2) { if (!class_exists('ConnectionManager') || Configure::read('debug') < 2) {
return false; return false;
} }
$noLogs = !isset($logs); $noLogs = !isset($sqlLogs);
if ($noLogs): if ($noLogs):
$sources = ConnectionManager::sourceList(); $sources = ConnectionManager::sourceList();
$logs = array(); $sqlLogs = array();
foreach ($sources as $source): foreach ($sources as $source):
$db = ConnectionManager::getDataSource($source); $db = ConnectionManager::getDataSource($source);
if (!method_exists($db, 'getLog')): if (!method_exists($db, 'getLog')):
continue; continue;
endif; endif;
$logs[$source] = $db->getLog(); $sqlLogs[$source] = $db->getLog();
endforeach; endforeach;
endif; endif;
if ($noLogs || isset($_forced_from_dbo_)): if ($noLogs || isset($_forced_from_dbo_)):
foreach ($logs as $source => $logInfo): foreach ($sqlLogs as $source => $logInfo):
$text = $logInfo['count'] > 1 ? 'queries' : 'query'; $text = $logInfo['count'] > 1 ? 'queries' : 'query';
printf( printf(
'<table class="cake-sql-log" id="cakeSqlLog_%s" summary="Cake SQL Log" cellspacing="0">', '<table class="cake-sql-log" id="cakeSqlLog_%s" summary="Cake SQL Log" cellspacing="0">',
@ -71,5 +71,5 @@ if ($noLogs || isset($_forced_from_dbo_)):
<?php <?php
endforeach; endforeach;
else: else:
echo '<p>Encountered unexpected $logs cannot generate SQL log</p>'; echo '<p>Encountered unexpected $sqlLogs cannot generate SQL log</p>';
endif; endif;