| Server IP : 180.180.241.3 / Your IP : 216.73.216.35 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /AppServ/www/app/Plugin/DebugKit/View/Elements/ |
Upload File : |
<?php
/**
* SQL Log Panel Element
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package DebugKit.View.Elements
* @since DebugKit 0.1
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
$headers = array('Query', 'Affected', 'Num. rows', 'Took (ms)', 'Actions');
if (isset($debugKitInHistoryMode)) {
$content = $this->Toolbar->readCache('sql_log', $this->request->params['pass'][0]);
}
?>
<h2><?php echo __d('debug_kit', 'Sql Logs')?></h2>
<?php if (!empty($content)) : ?>
<?php foreach ($content['connections'] as $dbName => $explain): ?>
<div class="sql-log-panel-query-log">
<h4><?php echo $dbName ?></h4>
<?php
if (!isset($debugKitInHistoryMode)):
$queryLog = $this->Toolbar->getQueryLogs($dbName, array(
'explain' => $explain, 'threshold' => $content['threshold']
));
else:
$queryLog = $content[$dbName];
endif;
echo '<h5>';
echo __d(
'debug_kit',
'Total Time: %s ms <br />Total Queries: %s queries',
$queryLog['time'],
$queryLog['count']
);
echo '</h5>';
echo $this->Toolbar->table($queryLog['queries'], $headers, array('title' => 'SQL Log ' . $dbName));
?>
<h4><?php echo __d('debug_kit', 'Query Explain:'); ?></h4>
<div id="sql-log-explain-<?php echo $dbName ?>">
<a id="debug-kit-explain-<?php echo $dbName ?>"> </a>
<p><?php echo __d('debug_kit', 'Click an "Explain" link above, to see the query explanation.'); ?></p>
</div>
</div>
<?php endforeach; ?>
<?php else:
echo $this->Toolbar->message('Warning', __d('debug_kit', 'No active database connections'));
endif; ?>