Index: t3lib/class.t3lib_tstemplate.php =================================================================== --- t3lib/class.t3lib_tstemplate.php (Revision 5716) +++ t3lib/class.t3lib_tstemplate.php (Arbeitskopie) @@ -241,7 +241,10 @@ $this->allowedPaths[] = $p; } } + if (!$GLOBALS['USE_TIMETRACK']) { + $this->tt_track = 0; } + } /** * Fetches the "currentPageData" array from cache Index: typo3/sysext/openid/sv1/class.tx_openid_sv1.php =================================================================== --- typo3/sysext/openid/sv1/class.tx_openid_sv1.php (Revision 5716) +++ typo3/sysext/openid/sv1/class.tx_openid_sv1.php (Arbeitskopie) @@ -453,7 +453,7 @@ } if (TYPO3_MODE == 'BE') { t3lib_div::sysLog($message, $this->extKey, 1); - } else { + } elseif ($GLOBALS['USE_TIMETRACK']) { $GLOBALS['TT']->setTSlogMessage($message); } if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['enable_DLOG']) { Index: typo3/sysext/cms/tslib/media/scripts/fe_adminLib.inc =================================================================== --- typo3/sysext/cms/tslib/media/scripts/fe_adminLib.inc (Revision 5716) +++ typo3/sysext/cms/tslib/media/scripts/fe_adminLib.inc (Arbeitskopie) @@ -1393,7 +1393,9 @@ * @return void */ function compileMail($key, $DBrows, $recipient, $setFixedConfig=array()) { + if ($GLOBALS['USE_TIMETRACK']) { $GLOBALS['TT']->push('compileMail'); + } $mailContent=''; $key = $this->emailMarkPrefix.$key; @@ -1421,11 +1423,15 @@ $recipient=$fe_userRec['email']; } + if ($GLOBALS['USE_TIMETRACK']) { $GLOBALS['TT']->setTSlogMessage('Template key: ###'.$key.'###, userContentLength: '.strlen($userContent['final']).', adminContentLength: '.strlen($adminContent['final'])); + } $this->sendMail($recipient, $this->conf['email.']['admin'], $userContent['final'], $adminContent['final']); + if ($GLOBALS['USE_TIMETRACK']) { $GLOBALS['TT']->pull(); } + } /** * Actually sends the requested mails (through $this->cObj->sendNotifyEmail or through $this->sendHTMLMail). Index: typo3/sysext/cms/tslib/class.tslib_fe.php =================================================================== --- typo3/sysext/cms/tslib/class.tslib_fe.php (Revision 5716) +++ typo3/sysext/cms/tslib/class.tslib_fe.php (Arbeitskopie) @@ -405,6 +405,7 @@ protected $pageCache; protected $pageCacheTags = array(); + protected $tt_track = FALSE; // use the timetrack object to log parsetimes and messages /** * Class constructor @@ -429,10 +430,15 @@ $this->TYPO3_CONF_VARS = $TYPO3_CONF_VARS; $this->id = $id; $this->type = $type; + if ($GLOBALS['USE_TIMETRACK']) { + $this->tt_track = TRUE; + } if ($no_cache) { if ($this->TYPO3_CONF_VARS['FE']['disableNoCacheParameter']) { $warning = '&no_cache=1 has been ignored because $TYPO3_CONF_VARS[\'FE\'][\'disableNoCacheParameter\'] is set!'; + if ($this->tt_track) { $GLOBALS['TT']->setTSlogMessage($warning,2); + } } else { $warning = '&no_cache=1 has been supplied, so caching is disabled! URL: "'.t3lib_div::getIndpEnv('TYPO3_REQUEST_URL').'"'; $this->no_cache = $no_cache ? 1 : 0; @@ -574,7 +580,9 @@ * @return void */ protected function initCaches() { + if ($this->tt_track) { $GLOBALS['TT']->push('Initializing the Caching System',''); + } $GLOBALS['typo3CacheManager'] = t3lib_div::makeInstance('t3lib_cache_Manager'); $GLOBALS['typo3CacheFactory'] = t3lib_div::makeInstance('t3lib_cache_Factory'); @@ -595,8 +603,10 @@ t3lib_cache::initPageSectionCache(); t3lib_cache::initContentHashCache(); + if ($this->tt_track) { $GLOBALS['TT']->pull(); } + } /** * Initializes the front-end login user. @@ -740,7 +750,9 @@ $this->setIDfromArgV(); // If there is a Backend login we are going to check for any preview settings: + if ($this->tt_track) { $GLOBALS['TT']->push('beUserLogin',''); + } if ($this->beUserLogin || $this->doWorkspacePreview()) { // Backend user preview features: @@ -809,7 +821,9 @@ $this->set_no_cache(); } } + if ($this->tt_track) { $GLOBALS['TT']->pull(); + } // Now, get the id, validate access etc: $this->fetch_the_id(); @@ -871,7 +885,9 @@ * @access private */ function fetch_the_id() { + if ($this->tt_track) { $GLOBALS['TT']->push('fetch_the_id initialize/',''); + } // Initialize the page-select functions. $this->sys_page = t3lib_div::makeInstance('t3lib_pageSelect'); @@ -904,10 +920,14 @@ // The id and type is set to the integer-value - just to be sure... $this->id = intval($this->id); $this->type = intval($this->type); + if ($this->tt_track) { $GLOBALS['TT']->pull(); + } // We find the first page belonging to the current domain + if ($this->tt_track) { $GLOBALS['TT']->push('fetch_the_id domain/',''); + } $this->domainStartPage = $this->findDomainRecord($this->TYPO3_CONF_VARS['SYS']['recursiveDomainSearch']); // the page_id of the current domain if (!$this->id) { if ($this->domainStartPage) { @@ -929,12 +949,18 @@ } } } + if ($this->tt_track) { $GLOBALS['TT']->pull(); + } + if ($this->tt_track) { $GLOBALS['TT']->push('fetch_the_id rootLine/',''); + } $requestedId = $this->id; // We store the originally requested id $this->getPageAndRootlineWithDomain($this->domainStartPage); + if ($this->tt_track) { $GLOBALS['TT']->pull(); + } if ($this->pageNotFound && $this->TYPO3_CONF_VARS['FE']['pageNotFound_handling']) { $pNotFoundMsg = array( @@ -1748,11 +1774,13 @@ $this->pageNotFoundAndExit('Request parameters could not be validated (&cHash comparison failed)'); } else { $this->set_no_cache(); + if ($this->tt_track) { $GLOBALS['TT']->setTSlogMessage('The incoming cHash "'.$this->cHash.'" and calculated cHash "'.$cHash_calc.'" did not match, so caching was disabled. The fieldlist used was "'.implode(',',array_keys($this->cHash_array)).'"',2); } } } } + } /** * Will disable caching if the cHash value was not set. @@ -1768,10 +1796,12 @@ $this->pageNotFoundAndExit('Request parameters could not be validated (&cHash empty)'); } else { $this->set_no_cache(); + if ($this->tt_track) { $GLOBALS['TT']->setTSlogMessage('TSFE->reqCHash(): No &cHash parameter was sent for GET vars though required so caching is disabled',2); } } } + } /** * Splits the input query-parameters into an array with certain parameters filtered out. @@ -1843,7 +1873,9 @@ if ($this->all) { $this->newHash = $this->getHash(); + if ($this->tt_track) { $GLOBALS['TT']->push('Cache Row',''); + } $row = $this->getFromCache_queryRow(); if (!is_array($row)) { @@ -1875,7 +1907,9 @@ $this->content.= chr(10).''; } } + if ($this->tt_track) { $GLOBALS['TT']->pull(); + } } else { $this->acquirePageGenerationLock($this->pages_lockObj, $lockHash); @@ -1889,9 +1923,13 @@ * @return array Cached row, if any. Otherwise void. */ function getFromCache_queryRow() { + if ($this->tt_track) { $GLOBALS['TT']->push('Cache Query', ''); + } $cachedPage = $this->pageCache->get($this->newHash); + if ($this->tt_track) { $GLOBALS['TT']->pull(); + } return $cachedPage; } @@ -1978,17 +2016,23 @@ $setStatPageName = false; if (!is_array($this->config) || is_array($this->config['INTincScript']) || $this->forceTemplateParsing) { // If config is not set by the cache (which would be a major mistake somewhere) OR if INTincScripts-include-scripts have been registered, then we must parse the template in order to get it + if ($this->tt_track) { $GLOBALS['TT']->push('Parse template',''); + } // Force parsing, if set?: $this->tmpl->forceTemplateParsing = $this->forceTemplateParsing; // Start parsing the TS template. Might return cached version. $this->tmpl->start($this->rootLine); + if ($this->tt_track) { $GLOBALS['TT']->pull(); + } if ($this->tmpl->loaded) { + if ($this->tt_track) { $GLOBALS['TT']->push('Setting the config-array',''); + } // t3lib_div::print_array($this->tmpl->setup); $this->sPre = $this->tmpl->setup['types.'][$this->type]; // toplevel - objArrayName $this->pSetup = $this->tmpl->setup[$this->sPre.'.']; @@ -2042,7 +2086,9 @@ $this->config['FEData'] = $this->tmpl->setup['FEData']; $this->config['FEData.'] = $this->tmpl->setup['FEData.']; } + if ($this->tt_track) { $GLOBALS['TT']->pull(); + } } else { if ($this->checkPageUnavailableHandler()) { $this->pageUnavailableAndExit('No TypoScript template found!'); @@ -2108,7 +2154,9 @@ function getCompressedTCarray() { global $TCA; + if ($this->tt_track) { $GLOBALS['TT']->push('Get Compressed TC array'); + } if (!$this->TCAloaded) { // Create hash string for storage / retrieval of cached content: $tempHash = md5('tables.php:'. @@ -2151,8 +2199,10 @@ } } } + if ($this->tt_track) { $GLOBALS['TT']->pull(); } + } /** * Includes TCA definitions from loaded extensions (ext_table.php files). @@ -2319,10 +2369,12 @@ $this->localeCharset = $this->csConvObj->get_locale_charset($this->config['config']['locale_all']); } else { + if ($this->tt_track) { $GLOBALS['TT']->setTSlogMessage('Locale "'.htmlspecialchars($this->config['config']['locale_all']).'" not found.', 3); } } } + } /** * checks whether a translated shortcut page has a different shortcut @@ -2376,11 +2428,15 @@ } elseif ($formtype_db && is_array($_POST['data'])) { $ret = 'fe_tce'; } + if ($this->tt_track) { $GLOBALS['TT']->setTSlogMessage('"Check Data Submission": Return value: '.$ret,0); + } return $ret; } - } else $GLOBALS['TT']->setTSlogMessage('"Check Data Submission": HTTP_HOST and REFERER HOST did not match when processing submitted formdata!',3); + } elseif ($this->tt_track) { + $GLOBALS['TT']->setTSlogMessage('"Check Data Submission": HTTP_HOST and REFERER HOST did not match when processing submitted formdata!',3); } + } // Hook for processing data submission to extensions: if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkDataSubmission'])) { @@ -2418,9 +2474,13 @@ if (!$locData[1] || $this->sys_page->checkRecord($locData[1],$locData[2],1)) { if (count($this->sys_page->getPage($locData[0]))) { // $locData[1] -check means that a record is checked only if the locationData has a value for a record else than the page. return 1; - } else $GLOBALS['TT']->setTSlogMessage('LocationData Error: The page pointed to by location data ('.$locationData.') was not accessible.',2); - } else $GLOBALS['TT']->setTSlogMessage('LocationData Error: Location data ('.$locationData.') record pointed to was not accessible.',2); + } elseif ($this->tt_track) { + $GLOBALS['TT']->setTSlogMessage('LocationData Error: The page pointed to by location data ('.$locationData.') was not accessible.',2); } + } elseif ($this->tt_track) { + $GLOBALS['TT']->setTSlogMessage('LocationData Error: Location data ('.$locationData.') record pointed to was not accessible.',2); + } + } /** * Sends the emails from the formmail content object. @@ -2447,13 +2507,17 @@ if ($res = $this->codeString($EMAIL_VARS[$fieldKey], TRUE)) { // Decode... $EMAIL_VARS[$fieldKey] = $res; // Set value if OK } elseif ($integrityCheck) { // Otherwise abort: + if ($this->tt_track) { $GLOBALS['TT']->setTSlogMessage('"Formmail" discovered a field ('.$fieldKey.') which could not be decoded to a valid string. Sending formmail aborted due to security reasons!',3); + } return false; } else { + if ($this->tt_track) { $GLOBALS['TT']->setTSlogMessage('"Formmail" discovered a field ('.$fieldKey.') which could not be decoded to a valid string. The security level accepts this, but you should consider a correct coding though!',2); } } } + } } else { $locData = explode(':',$locationData); $record = $this->sys_page->checkRecord($locData[1],$locData[2],1); @@ -2471,8 +2535,10 @@ $formmail->start($EMAIL_VARS); $formmail->sendtheMail(); + if ($this->tt_track) { $GLOBALS['TT']->setTSlogMessage('"Formmail" invoked, sending mail to '.$EMAIL_VARS['recipient'],0); } + } /** * Extracts the value of recipient copy field from a formmail CE bodytext @@ -2933,25 +2999,37 @@ // Tidy up the code, if flag... if ($this->TYPO3_CONF_VARS['FE']['tidy_option'] == 'all') { + if ($this->tt_track) { $GLOBALS['TT']->push('Tidy, all',''); + } $this->content = $this->tidyHTML($this->content); + if ($this->tt_track) { $GLOBALS['TT']->pull(); } + } // XHTML-clean the code, if flag set if ($this->doXHTML_cleaning() == 'all') { + if ($this->tt_track) { $GLOBALS['TT']->push('XHTML clean, all',''); + } $XHTML_clean = t3lib_div::makeInstance('t3lib_parsehtml'); $this->content = $XHTML_clean->XHTML_clean($this->content); + if ($this->tt_track) { $GLOBALS['TT']->pull(); } + } // Fix local anchors in links, if flag set if ($this->doLocalAnchorFix() == 'all') { + if ($this->tt_track) { $GLOBALS['TT']->push('Local anchor fix, all',''); + } $this->prefixLocalAnchorsWithScript(); + if ($this->tt_track) { $GLOBALS['TT']->pull(); } + } // Hook for post-processing of page content cached/non-cached: if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all'])) { @@ -2965,23 +3043,35 @@ if (!$this->no_cache) { // Tidy up the code, if flag... if ($this->TYPO3_CONF_VARS['FE']['tidy_option'] == 'cached') { + if ($this->tt_track) { $GLOBALS['TT']->push('Tidy, cached',''); + } $this->content = $this->tidyHTML($this->content); + if ($this->tt_track) { $GLOBALS['TT']->pull(); } + } // XHTML-clean the code, if flag set if ($this->doXHTML_cleaning() == 'cached') { + if ($this->tt_track) { $GLOBALS['TT']->push('XHTML clean, cached',''); + } $XHTML_clean = t3lib_div::makeInstance('t3lib_parsehtml'); $this->content = $XHTML_clean->XHTML_clean($this->content); + if ($this->tt_track) { $GLOBALS['TT']->pull(); } + } // Fix local anchors in links, if flag set if ($this->doLocalAnchorFix() == 'cached') { + if ($this->tt_track) { $GLOBALS['TT']->push('Local anchor fix, cached',''); + } $this->prefixLocalAnchorsWithScript(); + if ($this->tt_track) { $GLOBALS['TT']->pull(); } + } // Hook for post-processing of page content before being cached: if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-cached'])) { @@ -3042,13 +3132,17 @@ $reprocess = (count($INTiS_config) ? true : false); } while($reprocess); + if ($this->tt_track) { $GLOBALS['TT']->push('Substitute header section'); + } $this->INTincScript_loadJSCode(); $this->content = str_replace('', $this->convOutputCharset(implode(chr(10),$this->additionalHeaderData),'HD'), $this->content); $this->content = str_replace('', $this->convOutputCharset($this->divSection,'TDS'), $this->content); $this->setAbsRefPrefix(); + if ($this->tt_track) { $GLOBALS['TT']->pull(); } + } /** * Include libraries for uncached objects. @@ -3074,16 +3168,22 @@ * @see INTincScript() */ protected function INTincScript_process($INTiS_config) { + if ($this->tt_track) { $GLOBALS['TT']->push('Split content'); + } $INTiS_splitC = explode('') { // If the split had a comment-end after 32 characters it's probably a split-string $INTiS_key = 'INT_SCRIPT.'.substr($INTiS_cPart,0,32); + if ($this->tt_track) { $GLOBALS['TT']->push('Include '.$INTiS_config[$INTiS_key]['file'],''); + } $incContent=''; if (is_array($INTiS_config[$INTiS_key])) { $INTiS_cObj = unserialize($INTiS_config[$INTiS_key]['cObj']); @@ -3106,7 +3206,9 @@ } $this->content.= $this->convOutputCharset($incContent,'INC-'.$INTiS_c); $this->content.= substr($INTiS_cPart,35); + if ($this->tt_track) { $GLOBALS['TT']->pull($incContent); + } } else { $this->content.= ($INTiS_c?'