‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Configuration\Parser\PageTsConfigParser Class Reference

Public Member Functions

 __construct (TypoScriptParser $typoScriptParser, FrontendInterface $cache)
 
array parse (string $content, ConditionMatcherInterface $matcher, ?Site $site=null)
 

Protected Member Functions

array parseAndMatch (string $content, ConditionMatcherInterface $matcher)
 
array matching (array $sectionsToMatch, ConditionMatcherInterface $matcher)
 

Protected Attributes

TypoScriptParser $typoScriptParser
 
FrontendInterface $cache
 

Detailed Description

A TS-Config parsing class which performs condition evaluation.

This class does parsing of a compiled TSconfig string, and applies matching() based on the Context (FE or BE) in it, allowing to be fully agnostic to the outside world.

Deprecated:
‪since TYPO3 v12, will be removed with v13. Use PageTsConfigFactory instead. When removing, also remove entries in core Services.yaml.

Definition at line 34 of file PageTsConfigParser.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Configuration\Parser\PageTsConfigParser::__construct ( TypoScriptParser  $typoScriptParser,
FrontendInterface  $cache 
)

Member Function Documentation

◆ matching()

array TYPO3\CMS\Core\Configuration\Parser\PageTsConfigParser::matching ( array  $sectionsToMatch,
ConditionMatcherInterface  $matcher 
)
protected

Is just going through an array of conditions to determine which are matching (for getting correct cache entry)

Parameters
array$sectionsToMatch‪An array containing the sections to match
Returns
‪array The input array with matching sections to be filled into the "match" key

Definition at line 142 of file PageTsConfigParser.php.

References TYPO3\CMS\Core\Configuration\TypoScript\ConditionMatching\ConditionMatcherInterface\match().

Referenced by TYPO3\CMS\Core\Configuration\Parser\PageTsConfigParser\parse().

◆ parse()

array TYPO3\CMS\Core\Configuration\Parser\PageTsConfigParser::parse ( string  $content,
ConditionMatcherInterface  $matcher,
?Site  $site = null 
)

Parses and matches a given string Adds entries to the cache:

  • ‪when an exact on the conditions are there
  • ‪when a parse is there, then matches are happening anyway, and it is checked if this can be cached as well.

If a site is provided the settings stored in the site's configuration is available as constants for the TSconfig.

Parameters
string$content‪page TSconfig, usually accumulated by the PageTsConfigLoader
ConditionMatcherInterface$matcher‪an instance to match strings
Site | null$site‪The current site the page TSconfig is parsed for
Returns
‪array the

Definition at line 59 of file PageTsConfigParser.php.

References TYPO3\CMS\Core\Configuration\Parser\PageTsConfigParser\matching(), and TYPO3\CMS\Core\Configuration\Parser\PageTsConfigParser\parseAndMatch().

◆ parseAndMatch()

array TYPO3\CMS\Core\Configuration\Parser\PageTsConfigParser::parseAndMatch ( string  $content,
ConditionMatcherInterface  $matcher 
)
protected

Does the actual parsing using the TypoScriptParser "parse" method by applying a condition matcher.

Parameters
string$content‪The TSconfig being parsed
Returns
‪array Array containing the parsed TSconfig, the encountered sections, the matched sections. This is stored in cache.

Definition at line 126 of file PageTsConfigParser.php.

Referenced by TYPO3\CMS\Core\Configuration\Parser\PageTsConfigParser\parse().

Member Data Documentation

◆ $cache

FrontendInterface TYPO3\CMS\Core\Configuration\Parser\PageTsConfigParser::$cache
protected

◆ $typoScriptParser

TypoScriptParser TYPO3\CMS\Core\Configuration\Parser\PageTsConfigParser::$typoScriptParser
protected