TYPO3
7.6
|
Public Member Functions | |
setPageId ($pageId) | |
getPageId () | |
setRootline (array $rootline) | |
getRootline () | |
setSimulateMatchResult ($simulateMatchResult) | |
setSimulateMatchConditions (array $simulateMatchConditions) | |
match ($expression) | |
Protected Member Functions | |
normalizeExpression ($expression) | |
evaluateConditionCommon ($key, $value) | |
parseUserFuncArguments ($arguments) | |
getVariableCommon (array $vars) | |
compareNumber ($test, $leftValue) | |
searchStringWildcard ($haystack, $needle) | |
getBrowserInfo ($userAgent) | |
getDeviceType ($userAgent) | |
getGlobal ($var, $source=null) | |
evaluateCondition ($string) | |
getVariable ($name) | |
getGroupList () | |
determinePageId () | |
getPage () | |
determineRootline () | |
getUserId () | |
isUserLoggedIn () | |
log ($message) | |
Protected Attributes | |
$pageId | |
$rootline | |
$simulateMatchResult = false | |
$simulateMatchConditions = array() | |
Matching TypoScript conditions
Used with the TypoScript parser. Matches browserinfo, IPnumbers for use with templates
Definition at line 25 of file AbstractConditionMatcher.php.
|
protected |
Evaluates a $leftValue based on an operator: "<", ">", "<=", ">=", "!=" or "="
string | $test | The value to compare with on the form [operator][number]. Eg. "< 123 |
float | $leftValue | The value on the left side |
Definition at line 562 of file AbstractConditionMatcher.php.
References GeneralUtility\trimExplode().
Referenced by AbstractConditionMatcher\evaluateConditionCommon().
|
abstractprotected |
Determines the current page Id.
Referenced by AbstractConditionMatcher\match().
|
abstractprotected |
Determines the rootline for the current page.
Referenced by AbstractConditionMatcher\match().
|
abstractprotected |
Evaluates a TypoScript condition given as input, eg. "[browser=net][...(other conditions)...]"
string | $string | The condition to match against its criterias. |
Referenced by AbstractConditionMatcher\match().
|
protected |
Evaluates a TypoScript condition given as input, eg. "[applicationContext = Production][...(other condition)...]"
string | $key | The condition to match against its criterias. |
string | $value |
Definition at line 202 of file AbstractConditionMatcher.php.
References $GLOBALS, GeneralUtility\cmpFQDN(), GeneralUtility\cmpIP(), AbstractConditionMatcher\compareNumber(), GeneralUtility\compat_version(), GeneralUtility\deprecationLog(), elseif, GeneralUtility\getApplicationContext(), AbstractConditionMatcher\getBrowserInfo(), AbstractConditionMatcher\getDeviceType(), GeneralUtility\getIndpEnv(), AbstractConditionMatcher\getPage(), AbstractConditionMatcher\getUserId(), AbstractConditionMatcher\getVariable(), GeneralUtility\inList(), AbstractConditionMatcher\isUserLoggedIn(), AbstractConditionMatcher\parseUserFuncArguments(), AbstractConditionMatcher\searchStringWildcard(), and GeneralUtility\trimExplode().
Referenced by ConditionMatcher\evaluateCondition().
|
protected |
Generates an array with abstracted browser information
string | $userAgent | The useragent string, ::getIndpEnv('HTTP_USER_AGENT') |
Definition at line 644 of file AbstractConditionMatcher.php.
Referenced by AbstractConditionMatcher\evaluateConditionCommon().
|
protected |
Gets a code for a browsing device based on the input useragent string.
string | $userAgent | The useragent string, ::getIndpEnv('HTTP_USER_AGENT') |
Definition at line 656 of file AbstractConditionMatcher.php.
Referenced by AbstractConditionMatcher\evaluateConditionCommon().
|
protected |
Return global variable where the input string $var defines array keys separated by "|" Example: $var = "HTTP_SERVER_VARS | something" will return the value $GLOBALS['HTTP_SERVER_VARS']['something'] value
string | $var | Global var key, eg. "HTTP_GET_VAR" or "HTTP_GET_VARS|id" to get the GET parameter "id" back. |
array | $source | Alternative array than $GLOBAL to get variables from. |
Definition at line 669 of file AbstractConditionMatcher.php.
References $GLOBALS, and elseif.
Referenced by ConditionMatcher\getVariable(), and AbstractConditionMatcher\getVariableCommon().
|
abstractprotected |
Gets the usergroup list of the current user.
|
abstractprotected |
Gets the properties for the current page.
Referenced by AbstractConditionMatcher\evaluateConditionCommon().
getPageId | ( | ) |
Gets the id of the page to evaluate conditions for.
Definition at line 75 of file AbstractConditionMatcher.php.
References AbstractConditionMatcher\$pageId.
getRootline | ( | ) |
Gets the rootline.
Definition at line 98 of file AbstractConditionMatcher.php.
References AbstractConditionMatcher\$rootline.
|
abstractprotected |
Gets the id of the current user.
Referenced by AbstractConditionMatcher\evaluateConditionCommon().
|
abstractprotected |
Gets the value of a variable.
Examples of names:
string | $name | The name of the variable to fetch the value from |
Referenced by AbstractConditionMatcher\evaluateConditionCommon().
|
protected |
Get variable common
array | $vars |
Definition at line 514 of file AbstractConditionMatcher.php.
References GeneralUtility\_GP(), GeneralUtility\_GPmerged(), AbstractConditionMatcher\getGlobal(), and GeneralUtility\getIndpEnv().
Referenced by ConditionMatcher\getVariable().
|
abstractprotected |
Determines if a user is logged in.
Referenced by AbstractConditionMatcher\evaluateConditionCommon().
|
abstractprotected |
Sets a log message.
string | $message | The log message to set/write |
match | ( | $expression | ) |
Matches a TypoScript condition expression.
string | $expression | The expression to match |
Definition at line 153 of file AbstractConditionMatcher.php.
References AbstractConditionMatcher\$simulateMatchResult, AbstractConditionMatcher\determinePageId(), AbstractConditionMatcher\determineRootline(), AbstractConditionMatcher\evaluateCondition(), and AbstractConditionMatcher\normalizeExpression().
|
protected |
Normalizes an expression and removes the first and last square bracket.
string | $expression | The expression to be normalized (e.g. "[A] && [B] OR [C]") |
Definition at line 135 of file AbstractConditionMatcher.php.
Referenced by AbstractConditionMatcher\match().
|
protected |
Parses arguments to the userFunc.
string | $arguments |
Definition at line 477 of file AbstractConditionMatcher.php.
Referenced by AbstractConditionMatcher\evaluateConditionCommon().
|
protected |
Matching two strings against each other, supporting a "*" wildcard or (if wrapped in "/") PCRE regular expressions
string | $haystack | The string in which to find $needle. |
string | $needle | The string to find in $haystack |
Definition at line 618 of file AbstractConditionMatcher.php.
References elseif.
Referenced by AbstractConditionMatcher\evaluateConditionCommon().
setPageId | ( | $pageId | ) |
Sets the id of the page to evaluate conditions for.
int | $pageId | Id of the page (must be positive) |
Definition at line 63 of file AbstractConditionMatcher.php.
References AbstractConditionMatcher\$pageId.
setRootline | ( | array | $rootline | ) |
Sets the rootline.
array | $rootline | The rootline to be used for matching (must have elements) |
Definition at line 86 of file AbstractConditionMatcher.php.
References AbstractConditionMatcher\$rootline.
setSimulateMatchConditions | ( | array | $simulateMatchConditions | ) |
Sets whether to simulate the behaviour and match specific conditions.
array | $simulateMatchConditions | Conditions to simulate a match for |
Definition at line 122 of file AbstractConditionMatcher.php.
References AbstractConditionMatcher\$simulateMatchConditions.
setSimulateMatchResult | ( | $simulateMatchResult | ) |
Sets whether to simulate the behaviour and match all conditions.
bool | $simulateMatchResult | Whether to simulate positive matches |
Definition at line 109 of file AbstractConditionMatcher.php.
References AbstractConditionMatcher\$simulateMatchResult.
|
protected |
Definition at line 32 of file AbstractConditionMatcher.php.
Referenced by ConditionMatcher\determinePageId(), ConditionMatcher\determineRootline(), ConditionMatcher\getPage(), AbstractConditionMatcher\getPageId(), ConditionMatcher\getPageIdByRecord(), ConditionMatcher\isNewPageWithPageId(), and AbstractConditionMatcher\setPageId().
|
protected |
Definition at line 39 of file AbstractConditionMatcher.php.
Referenced by AbstractConditionMatcher\getRootline(), and AbstractConditionMatcher\setRootline().
|
protected |
Definition at line 55 of file AbstractConditionMatcher.php.
Referenced by AbstractConditionMatcher\setSimulateMatchConditions().
|
protected |
Definition at line 47 of file AbstractConditionMatcher.php.
Referenced by AbstractConditionMatcher\match(), and AbstractConditionMatcher\setSimulateMatchResult().