示例#1
0
 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['db']['objectpopulation'] = \b2db\Core::getObjectPopulationHits();
         $tbg_summary['db']['objecttiming'] = \b2db\Core::getObjectPopulationTiming();
         $tbg_summary['db']['objectcount'] = \b2db\Core::getObjectPopulationCount();
     }
     $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 Scope ? $scope->getID() : 'unknown';
     $tbg_summary['scope']['hostnames'] = $scope instanceof Scope && \b2db\Core::isConnected() ? implode(', ', $scope->getHostnames()) : 'unknown';
     $tbg_summary['settings'] = Settings::getAll();
     $tbg_summary['memory'] = memory_get_usage();
     $tbg_summary['partials'] = self::getVisitedPartials();
     $tbg_summary['log'] = Logging::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___']) > 25) {
             array_shift($_SESSION['___DEBUGINFO___']);
         }
     }
 }
示例#2
0
    ?>
</span>&nbsp;&nbsp;<span class="csp-dbg-log-msg"><?php 
    echo $entry['message'];
    ?>
</span><br />
						<?php 
}
?>
						</div>
					</div>
					<div id="csp-dbg-row-<?php 
echo $cspdbgrow;
?>
-content-tab-5-panel" class="csp-dbg-tab-panel" style="display: none;">
<?php 
if (\b2db\Core::isConnected()) {
    ?>
						<p><i>This list shows all the SQL queries that have been made, and how long each took.</i></p>
						<?php 
    $i = 0;
    ?>
						<?php 
    foreach ($dbgqueries as $entry) {
        ?>
							<?php 
        $i++;
        ?>
							<div class="csp-dbg-query-title">
								<span class="csp-dbg-query-title-id">Query <?php 
        echo $i;
        ?>
示例#3
0
 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___']);
         }
     }
 }