inner); // Replace .foo with loops.foo|length $inner = preg_replace('#(\s\(*!?)\.([a-zA-Z_0-9]+)([^a-zA-Z_0-9\.])#', '$1loops.$2|length$3', $inner); // Replace .foo.bar with foo.bar|length $inner = preg_replace('#(\s\(*!?)\.([a-zA-Z_0-9\.]+)([^a-zA-Z_0-9\.])#', '$1$2|length$3', $inner); return ""; }; return preg_replace_callback('##', $callback, $code); } /** * Fix DEFINE statements and {$VARNAME} variables * * @param string $code * @return string */ protected function fix_define_tokens($code) { /** * Changing $VARNAME to definition.varname because set is only local * context (e.g. DEFINE $TEST will only make $TEST available in current * template and any child templates, but not any parent templates). * * DEFINE handles setting it properly to definition in its node, but the * variables reading FROM it need to be altered to definition.VARNAME * * Setting up definition as a class in the array passed to Twig * ($context) makes set definition.TEST available in the global context */ // Replace #', '{% DEFINE $1 %}', $code); // Changing UNDEFINE NAME to DEFINE NAME = null to save from creating an extra token parser/node $code = preg_replace('##', '{% DEFINE $1= null %}', $code); // Replace all of our variables, {$VARNAME}, with Twig style, {{ definition.VARNAME }} $code = preg_replace('#{\$([a-zA-Z0-9_\.]+)}#', '{{ definition.$1 }}', $code); // Replace all of our variables, ~ $VARNAME ~, with Twig style, ~ definition.VARNAME ~ $code = preg_replace('#~ \$([a-zA-Z0-9_\.]+) ~#', '~ definition.$1 ~', $code); return $code; } /** * Replace Twig tag masks with Twig tag calls * * E.g. with {% block foo %} * * @param string $code * @param array $twig_tags All tags we want to create a mask for * @return string */ protected function replace_twig_tag_masks($code, $twig_tags) { $callback = function ($matches) { $matches[1] = strtolower($matches[1]); return "{% {$matches[1]}{$matches[2]}%}"; }; foreach ($twig_tags as &$tag) { $tag = strtoupper($tag); } // twig_tags is an array of the twig tags, which are all lowercase, but we use all uppercase tags $code = preg_replace_callback('##',$callback, $code); return $code; } }
Fatal error: Uncaught Error: Class 'phpbb\template\twig\lexer' not found in /home/acumstiu/gpszone.ro/cache/production/container_4335734bbdd20f586549a504dff5f80c.php:6991 Stack trace: #0 /home/acumstiu/gpszone.ro/phpbb/di/container_builder.php(156): require() #1 /home/acumstiu/gpszone.ro/common.php(115): phpbb\di\container_builder->get_container() #2 /home/acumstiu/gpszone.ro/index.php(23): include('/home/acumstiu/...') #3 {main} thrown in /home/acumstiu/gpszone.ro/cache/production/container_4335734bbdd20f586549a504dff5f80c.php on line 6991