2 declare(strict_types = 1);
18 use Symfony\Component\ExpressionLanguage\ExpressionFunction;
19 use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface;
52 return new ExpressionFunction(
57 function ($arguments, $str) {
58 if ($str ===
'devIP') {
59 $str = trim(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'devIPmask'] ??
'');
61 return (
bool)GeneralUtility::cmpIP(GeneralUtility::getIndpEnv(
'REMOTE_ADDR'), $str);
68 return new ExpressionFunction(
73 function ($arguments, $str) {
82 return new ExpressionFunction(
'like',
function () {
84 },
function ($arguments, $haystack, $needle) {
92 return ExpressionFunction::fromPhp(
'getenv');
97 return new ExpressionFunction(
'date',
function () {
99 },
function ($arguments, $format) {
100 return GeneralUtility::makeInstance(Context::class)
101 ->getAspect(
'date')->getDateTime()->format($format);
107 return new ExpressionFunction(
'feature',
function () {
109 },
function ($arguments, $featureName) {
110 return GeneralUtility::makeInstance(Features::class)
111 ->isFeatureEnabled($featureName);
117 return new ExpressionFunction(
'traverse',
function () {
119 },
function ($arguments, $array, $path) {
120 if (!is_array($array) || !is_string($path) || $path ===
'') {