Actions
Bug #53370
closedCache getPagesTSconfig per ID and rootline
Start date:
2013-11-06
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
During the discussion of #53368 the idea came up to improve the behaviour of \TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig. If a proper memory cache would be used there, the whole parsing would be done only once per request for a certain page ID and rootline.
Updated by Jo Hasenau about 11 years ago
static public function getPagesTSconfig($id, $rootLine = '', $returnPartArray = 0) { $id = intval($id); if (!is_array($rootLine)) { $rootLine = self::BEgetRootLine($id, '', TRUE); } // Order correctly ksort($rootLine); $TSdataArray = array(); // Setting default configuration $TSdataArray['defaultPageTSconfig'] = $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig']; foreach ($rootLine as $k => $v) { $TSdataArray['uid_' . $v['uid']] = $v['TSconfig']; } $TSdataArray = TypoScriptParser::checkIncludeLines_array($TSdataArray); if ($returnPartArray) { return $TSdataArray; } // Parsing the page TS-Config $pageTS = implode(LF . '[GLOBAL]' . LF, $TSdataArray); /* @var $parseObj \TYPO3\CMS\Backend\Configuration\TsConfigParser */ $parseObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Configuration\\TsConfigParser'); $res = $parseObj->parseTSconfig($pageTS, 'PAGES', $id, $rootLine); if ($res) { $TSconfig = $res['TSconfig']; } // Get User TSconfig overlay $userTSconfig = $GLOBALS['BE_USER']->userTS['page.']; if (is_array($userTSconfig)) { $TSconfig = GeneralUtility::array_merge_recursive_overrule($TSconfig, $userTSconfig); } return $TSconfig; }
While parseTSconfig already should make use of a cache, which is not working properly at the moment, we could still improve this method by creating TSconfig only once per request. This does not have to make use of the fully fledged caching framework but could use a variable to return it early.
This way we could get rid of having to do array_merge_recursive_overrule umpteen times during a single request.
Updated by Georg Ringer about 11 years ago
- Subject changed from Cahe getPagesTSconfig per ID and rootline to Cache getPagesTSconfig per ID and rootline
Updated by Georg Ringer almost 10 years ago
- Status changed from New to Resolved
resolved with #63629
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed
Actions