public function contentPostProc($_funcRef, $_params)
 {
     $nbQueries = $GLOBALS['TYPO3_DB']->profiling();
     $conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['typo3profiler']);
     $logTS = $GLOBALS['TT']->printTSlog();
     $logTS = preg_replace('/src="typo3/', 'src="/typo3', $logTS);
     $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_typo3profiler_page', 'page=' . intval($GLOBALS['TSFE']->id));
     $GLOBALS['TYPO3_DB']->exec_INSERTQuery('tx_typo3profiler_page', array('pid' => 0, 'parsetime' => $GLOBALS['TSFE']->scriptParseTime, 'page' => $GLOBALS['TSFE']->id, 'logts' => $logTS, 'size' => \TYPO3\CMS\Core\Utility\GeneralUtility::formatSize(strlen($GLOBALS['TSFE']->content)), 'nocache' => $GLOBALS['TSFE']->no_cache ? 1 : 0, 'userint' => count($GLOBALS['TSFE']->config['INTincScript']), 'nbqueries' => $nbQueries));
     if ($conf['debugbarenabled'] == 1) {
         Typo3profiler_Utility_Debugbar::render();
     }
 }
Exemplo n.º 2
0
<?php

if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}
$extensionPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('typo3profiler');
require_once $extensionPath . 'Classes/Utility/Compatibility.php';
require_once $extensionPath . 'Classes/Utility/Debugbar.php';
$conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['typo3profiler']);
if ($conf['enabled'] == 1) {
    // For profiling rendering
    $TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe']['typo3profiler'] = 'EXT:typo3profiler/Classes/Hook/class.user_typo3profiler_hooks.php:&user_typo3profiler->contentPostProc';
    $TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['postInit']['typo3profiler'] = 'EXT:typo3profiler/Classes/Hook/class.user_typo3profiler_hooks.php:&user_typo3profiler';
    if (Typo3profiler_Utility_Compatibility::intFromVer(TYPO3_version) > 6000000) {
        require_once $extensionPath . 'Classes/Xclass/DatabaseConnection.php';
        $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3\\CMS\\Core\\Database\\DatabaseConnection'] = array('className' => 'Typo3profiler_Xclass_DatabaseConnection');
    }
}
if ($conf['debugbarenabled'] == 1) {
    Typo3profiler_Utility_Debugbar::init();
}