protected static function generateDebugInfo() { $tbg_summary = array(); $load_time = self::getLoadtime(); if (\b2db\Core::isInitialized()) { $tbg_summary['db']['queries'] = \b2db\Core::getSQLHits(); $tbg_summary['db']['timing'] = \b2db\Core::getSQLTiming(); } $tbg_summary['load_time'] = $load_time >= 1 ? round($load_time, 2) . 's' : round($load_time * 1000, 1) . 'ms'; $tbg_summary['scope'] = array(); $scope = self::getScope(); $tbg_summary['scope']['id'] = $scope instanceof TBGScope ? $scope->getID() : 'unknown'; $tbg_summary['scope']['hostnames'] = $scope instanceof TBGScope && \b2db\Core::isConnected() ? implode(', ', $scope->getHostnames()) : 'unknown'; $tbg_summary['settings'] = TBGSettings::getAll(); $tbg_summary['memory'] = memory_get_usage(); $tbg_summary['partials'] = self::getVisitedPartials(); if (self::$_i18n instanceof TBGI18n) { foreach (self::getI18n()->getMissingStrings() as $text => $value) { TBGLogging::log('The text "' . $text . '" does not exist in list of translated strings, and was added automatically', 'i18n', TBGLogging::LEVEL_NOTICE); } } $tbg_summary['log'] = TBGLogging::getEntries(); $tbg_summary['routing'] = array('name' => self::getRouting()->getCurrentRouteName(), 'module' => self::getRouting()->getCurrentRouteModule(), 'action' => self::getRouting()->getCurrentRouteAction()); if (isset($_SESSION)) { if (!array_key_exists('___DEBUGINFO___', $_SESSION)) { $_SESSION['___DEBUGINFO___'] = array(); } $_SESSION['___DEBUGINFO___'][self::$debug_id] = $tbg_summary; while (count($_SESSION['___DEBUGINFO___']) > 10) { array_shift($_SESSION['___DEBUGINFO___']); } } }
<?php echo image_tag('debug_log.png', array('style' => 'float: right; margin-left: 5px; cursor: pointer;')); ?> </span> </td> </tr> </table> </div> <div id="scope_settings" style="display: none;"> <div style="font-size: 16px; font-weight: bold; border-bottom: 1px solid #DDD; padding: 4px;">Scope <?php echo TBGContext::getScope()->getID(); ?> settings</div> <div class="log"> <?php foreach (TBGSettings::getAll() as $module => $settings) { ?> <h3><?php echo $module; ?> </h3> <table style="border: 0;" cellpadding="0" cellspacing="0"> <?php foreach ($settings as $setting => $setting_details) { ?> <tr> <td style="font-size: 12px; padding: 1px 5px 1px 1px;"><b><?php echo $setting; ?> : </b></td> <td style="font-size: 12px;">