2 namespace TYPO3\CMS\Backend\Configuration;
50 $hash = md5($type .
':' . $TStext);
51 $cachedContent = BackendUtility::getHash($hash);
52 if (is_array($cachedContent)) {
53 $storedData = $cachedContent[0];
54 $storedMD5 = $cachedContent[1];
55 $storedData[
'match'] = array();
56 $storedData = $this->matching($storedData);
57 $checkMD5 = md5(serialize($storedData));
58 if ($checkMD5 == $storedMD5) {
60 'TSconfig' => $storedData[
'TSconfig'],
65 $shash = md5($checkMD5 . $hash);
66 $cachedSpec = BackendUtility::getHash($shash);
67 if (is_array($cachedSpec)) {
68 $storedData = $cachedSpec;
70 'TSconfig' => $storedData[
'TSconfig'],
75 $storeData = $this->parseWithConditions($TStext);
76 BackendUtility::storeHash($shash, $storeData, $type .
'_TSconfig');
78 'TSconfig' => $storeData[
'TSconfig'],
85 $storeData = $this->parseWithConditions($TStext);
86 $md5 = md5(serialize($storeData));
87 BackendUtility::storeHash($hash, array($storeData, $md5), $type .
'_TSconfig');
89 'TSconfig' => $storeData[
'TSconfig'],
103 protected function parseWithConditions($TSconfig)
106 $matchObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Configuration\TypoScript\ConditionMatching\ConditionMatcher::class);
107 $matchObj->setRootline($this->rootLine);
108 $matchObj->setPageId($this->
id);
109 $this->
parse($TSconfig, $matchObj);
111 'TSconfig' => $this->setup,
112 'sections' => $this->sections,
113 'match' => $this->sectionsMatch
123 protected function matching(array $cc)
125 if (is_array($cc[
'sections'])) {
127 $matchObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Configuration\TypoScript\ConditionMatching\ConditionMatcher::class);
128 $matchObj->setRootline($this->rootLine);
129 $matchObj->setPageId($this->
id);
130 foreach ($cc[
'sections'] as $key => $pre) {
131 if ($matchObj->match($pre)) {
132 $cc[
'match'][$key] = $pre;