mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
resolve unnecessary naming conflict in SQL dump output
This commit is contained in:
parent
a10275fb8b
commit
4c4fdc6f70
1 changed files with 5 additions and 5 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue