Just some notifications for @ zdenek-machek's answer:
1) To request database queries, the BjyProfiler module must be installed.
2) (skip if you use PDO) When I used BjyProfiler last time, there was a problem with mysqli connection ( buffer_results option buffer_results not passed to ProfilingStatement class). Perhaps this has been fixed now, or I have configured it incorrectly, but my patch should manually pass this parameter to BjyProfiler / src / BjyProfiler / Db / Adapter / ProfilingAdapter.php:
case 'Zend\Db\Adapter\Driver\Mysqli\Mysqli': $statementPrototype = new Driver\Mysqli\ProfilingStatement($this->options['buffer_results']); break;
3) ZendDeveloperTools displays the number of requests, but does not list them. To list at the bottom of the page, I changed view / zend-developer-tools / toolbar / toolbar.phtml as follows:
<?php $queryProfiles = $this->getHelperPluginManager()->getServiceLocator() ->get('Zend\Db\Adapter\Adapter')->getProfiler()->getQueryProfiles(); echo '<ol>'; foreach($queryProfiles as $queryObj) { $query = $queryObj->toArray(); echo '<li>'; echo '<b>' . ($query['elapsed']*1000) . '</b> ms<br/>'; echo $query['sql']; if(count($query['parameters'])) { echo '<br/><i>Parameters:</i> '; $list = array(); foreach($query['parameters'] as $key => $value) $list[] = '?'. $this->escapeHtml($key) ."='". $this->escapeHtml($value) ."'"; echo implode(', ', $list); } echo '</li>'; } echo '</ol>';
source share