diff --git a/typo3/sysext/core/Classes/Tree/TableConfiguration/DatabaseTreeDataProvider.php b/typo3/sysext/core/Classes/Tree/TableConfiguration/DatabaseTreeDataProvider.php index 2e78955..5cd8f8d 100644 --- a/typo3/sysext/core/Classes/Tree/TableConfiguration/DatabaseTreeDataProvider.php +++ b/typo3/sysext/core/Classes/Tree/TableConfiguration/DatabaseTreeDataProvider.php @@ -255,8 +255,9 @@ class DatabaseTreeDataProvider extends AbstractTableConfigurationTreeDataProvide $node->setHasChildren(TRUE); /** @var $childNodes \TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection */ $childNodes = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\SortedTreeNodeCollection'); + $basicNode->getChildNodes()->asort(); foreach ($basicNode->getChildNodes() as $child) { - $childNodes->append($this->buildRepresentationForNode($child, $node, $level + 1)); + $childNodes[] = $this->buildRepresentationForNode($child, $node, $level + 1); } $node->setChildNodes($childNodes); } diff --git a/typo3/sysext/core/Classes/TypoScript/Parser/TypoScriptParser.php b/typo3/sysext/core/Classes/TypoScript/Parser/TypoScriptParser.php index dcdbfcf..5b6c99d 100644 --- a/typo3/sysext/core/Classes/TypoScript/Parser/TypoScriptParser.php +++ b/typo3/sysext/core/Classes/TypoScript/Parser/TypoScriptParser.php @@ -16,6 +16,7 @@ namespace TYPO3\CMS\Core\TypoScript\Parser; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\PathUtility; +use TYPO3\CMS\Core\Cache\CacheManager; /** * The TypoScript parser @@ -210,47 +211,57 @@ class TypoScriptParser { * @todo Define visibility */ public function parse($string, $matchObj = '') { - $this->raw = explode(LF, $string); - $this->rawP = 0; - $pre = '[GLOBAL]'; - while ($pre) { - if ($this->breakPointLN && $pre === '[_BREAK]') { - $this->error('Breakpoint at ' . ($this->lineNumberOffset + $this->rawP - 2) . ': Line content was "' . $this->raw[($this->rawP - 2)] . '"', 1); - break; + $typoscriptCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_typoscript'); + //var_export($typoscriptCache->get(md5($string)));die(); + $hash = md5($string.serialize($matchObj)); + if (($cached = $typoscriptCache->get($hash)) !== false) { + foreach ($cached as $key => $value) { + $this->$key = $value; } - $preUppercase = strtoupper($pre); - if ($pre[0] === '[' && - ($preUppercase === '[GLOBAL]' || - $preUppercase === '[END]' || - !$this->lastConditionTrue && $preUppercase === '[ELSE]') - ) { - $pre = trim($this->parseSub($this->setup)); - $this->lastConditionTrue = 1; - } else { - // We're in a specific section. Therefore we log this section - $specificSection = $preUppercase !== '[ELSE]'; - if ($specificSection) { - $this->sections[md5($pre)] = $pre; + } else { + $this->raw = explode(LF, $string); + $this->rawP = 0; + $pre = '[GLOBAL]'; + while ($pre) { + if ($this->breakPointLN && $pre === '[_BREAK]') { + $this->error('Breakpoint at ' . ($this->lineNumberOffset + $this->rawP - 2) . ': Line content was "' . $this->raw[($this->rawP - 2)] . '"', 1); + break; } - if (is_object($matchObj) && $matchObj->match($pre) || $this->syntaxHighLight) { - if ($specificSection) { - $this->sectionsMatch[md5($pre)] = $pre; - } + $preUppercase = strtoupper($pre); + if ($pre[0] === '[' && + ($preUppercase === '[GLOBAL]' || + $preUppercase === '[END]' || + !$this->lastConditionTrue && $preUppercase === '[ELSE]') + ) { $pre = trim($this->parseSub($this->setup)); $this->lastConditionTrue = 1; } else { - $pre = $this->nextDivider(); - $this->lastConditionTrue = 0; + // We're in a specific section. Therefore we log this section + $specificSection = $preUppercase !== '[ELSE]'; + if ($specificSection) { + $this->sections[md5($pre)] = $pre; + } + if (is_object($matchObj) && $matchObj->match($pre) || $this->syntaxHighLight) { + if ($specificSection) { + $this->sectionsMatch[md5($pre)] = $pre; + } + $pre = trim($this->parseSub($this->setup)); + $this->lastConditionTrue = 1; + } else { + $pre = $this->nextDivider(); + $this->lastConditionTrue = 0; + } } } + if ($this->inBrace) { + $this->error('Line ' . ($this->lineNumberOffset + $this->rawP - 1) . ': The script is short of ' . $this->inBrace . ' end brace(s)', 1); + } + if ($this->multiLineEnabled) { + $this->error('Line ' . ($this->lineNumberOffset + $this->rawP - 1) . ': A multiline value section is not ended with a parenthesis!', 1); + } + $this->lineNumberOffset += count($this->raw) + 1; + $typoscriptCache->set($hash, $this); } - if ($this->inBrace) { - $this->error('Line ' . ($this->lineNumberOffset + $this->rawP - 1) . ': The script is short of ' . $this->inBrace . ' end brace(s)', 1); - } - if ($this->multiLineEnabled) { - $this->error('Line ' . ($this->lineNumberOffset + $this->rawP - 1) . ': A multiline value section is not ended with a parenthesis!', 1); - } - $this->lineNumberOffset += count($this->raw) + 1; } /** diff --git a/typo3/sysext/core/Configuration/DefaultConfiguration.php b/typo3/sysext/core/Configuration/DefaultConfiguration.php index ca11972..11bdba3 100644 --- a/typo3/sysext/core/Configuration/DefaultConfiguration.php +++ b/typo3/sysext/core/Configuration/DefaultConfiguration.php @@ -206,6 +206,14 @@ return array( ), 'groups' => array('system') ), + 'cache_typoscript' => array( + 'frontend' => 'TYPO3\CMS\Core\Cache\Frontend\VariableFrontend', + 'backend' => 'TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend', + 'options' => array( + 'defaultLifetime' => 0, + ), + 'groups' => array('system') + ), ), ), 'defaultCategorizedTables' => 'pages,tt_content,sys_file_metadata', // List of comma separated tables that are categorizable by default.