AbstractConditionMatcher

abstract class \TYPO3\CMS\Core\Configuration\TypoScript\ConditionMatching\AbstractConditionMatcher

Implements
LoggerAwareInterface, ConditionMatcherInterface
Uses
LoggerAwareTrait

Matching TypoScript conditions

Deprecated

since v12, will be removed in v13 together with old TypoScript parser

Used with the TypoScript parser. Matches IP numbers etc. for use with templates

Table of Contents

Interfaces

LoggerAwareInterface
ConditionMatcherInterface
Used for TypoScript Conditions to be evaluated.

Properties

$expressionLanguageResolver  : Resolver
$expressionLanguageResolverVariables  : array
$pageId  : int
Id of the current page.
$rootline  : array
The rootline for the current page.
$simulateMatchConditions  : array
Whether to simulate the behaviour and match specific conditions (used in TypoScript object browser).
$simulateMatchResult  : bool
Whether to simulate the behaviour and match all conditions (used in TypoScript object browser).

Methods

getPageId()  : int
Gets the id of the page to evaluate conditions for.
getRootline()  : array
Gets the rootline.
match()  : bool
Matches a TypoScript condition expression.
setPageId()  : mixed
Sets the id of the page to evaluate conditions for.
setRootline()  : mixed
Sets the rootline.
setSimulateMatchConditions()  : mixed
Sets whether to simulate the behaviour and match specific conditions.
setSimulateMatchResult()  : mixed
Sets whether to simulate the behaviour and match all conditions.
evaluateExpression()  : bool
initializeExpressionLanguageResolver()  : void
updateExpressionLanguageVariables()  : void

Properties

$expressionLanguageResolverVariables

protected array $expressionLanguageResolverVariables = []

$pageId

Id of the current page.

protected int $pageId

$rootline

The rootline for the current page.

protected array $rootline

Tags

todo:

In FE, this is the "stops at sys_template root" TSFE->config['rootLine'] one, from the uppermost page down to leaf page. In BE, this is the full rootline from the uppermost page down to leaf page. Refactor this mess, also see $fullRootline in FE ConditionMatcher.

$simulateMatchConditions

Whether to simulate the behaviour and match specific conditions (used in TypoScript object browser).

protected array $simulateMatchConditions = []

$simulateMatchResult

Whether to simulate the behaviour and match all conditions (used in TypoScript object browser).

protected bool $simulateMatchResult = false

Methods

getPageId()

Gets the id of the page to evaluate conditions for.

public getPageId() : int

Return values

int —

Id of the page

getRootline()

Gets the rootline.

public getRootline() : array

Tags

todo:

Set to protected. These classes should be data-sinks, not data-sources.

Return values

array —

The rootline to be used for matching

match()

Matches a TypoScript condition expression.

public match(string $expression) : bool

Parameters

$expression : string

The expression to match

Return values

bool —

Whether the expression matched

setPageId()

Sets the id of the page to evaluate conditions for.

public setPageId(int $pageId) : mixed

Parameters

$pageId : int

Id of the page (must be positive)

setRootline()

Sets the rootline.

public setRootline(array $rootline) : mixed

Parameters

$rootline : array

The rootline to be used for matching (must have elements)

setSimulateMatchConditions()

Sets whether to simulate the behaviour and match specific conditions.

public setSimulateMatchConditions(array $simulateMatchConditions) : mixed

Parameters

$simulateMatchConditions : array

Conditions to simulate a match for

setSimulateMatchResult()

Sets whether to simulate the behaviour and match all conditions.

public setSimulateMatchResult(bool $simulateMatchResult) : mixed

Parameters

$simulateMatchResult : bool

Whether to simulate positive matches

evaluateExpression()

protected evaluateExpression(string $expression) : bool

Parameters

$expression : string

Return values

bool

initializeExpressionLanguageResolver()

protected initializeExpressionLanguageResolver() : void

updateExpressionLanguageVariables()

protected updateExpressionLanguageVariables() : void
On this page