/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/debug_kit/src/Panel
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/debug_kit/src/Panel/SqlLogPanel.php (3072B)
configName() === 'debug_kit'
|| !$connection instanceof ConnectionInterface
) {
continue;
}
$logger = null;
if ($connection->isQueryLoggingEnabled()) {
$logger = $connection->getLogger();
}
if ($logger instanceof DebugLog) {
$logger->setIncludeSchema($includeSchemaReflection);
$this->_loggers[] = $logger;
continue;
}
$logger = new DebugLog($logger, $name, $includeSchemaReflection);
$connection->enableQueryLogging(true);
$connection->setLogger($logger);
$this->_loggers[] = $logger;
}
}
/**
* Get the data this panel wants to store.
*
* @return array
*/
public function data()
{
return [
'tables' => array_map(function (Table $table) {
return $table->getAlias();
}, $this->getTableLocator()->genericInstances()),
'loggers' => $this->_loggers,
];
}
/**
* Get summary data from the queries run.
*
* @return string
*/
public function summary()
{
$count = $time = 0;
foreach ($this->_loggers as $logger) {
$count += count($logger->queries());
$time += $logger->totalTime();
}
if (!$count) {
return '0';
}
return "$count / $time ms";
}
}