From e7e6d45789d4084b98a9c6227a42976e4a1d8f7f Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sun, 10 Aug 2014 02:26:16 +0200 Subject: [ticket/12957] Update the constructions of the template engine PHPBB3-12957 --- phpBB/phpbb/template/twig/environment.php | 1 + phpBB/phpbb/template/twig/lexer.php | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php index f6d9b73178..b3f57b016f 100644 --- a/phpBB/phpbb/template/twig/environment.php +++ b/phpBB/phpbb/template/twig/environment.php @@ -79,6 +79,7 @@ class environment extends \Twig_Environment if (null === $this->lexer) { $this->lexer = $this->container->get('template.twig.lexer'); + $this->lexer->set_environment($this); } return $this->lexer; diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php index c5dc7273ba..a7848738bb 100644 --- a/phpBB/phpbb/template/twig/lexer.php +++ b/phpBB/phpbb/template/twig/lexer.php @@ -15,6 +15,11 @@ namespace phpbb\template\twig; class lexer extends \Twig_Lexer { + public function set_environment(\Twig_Environment $env) + { + $this->env = $env; + } + public function tokenize($code, $filename = null) { // Our phpBB tags -- cgit v1.2.1 From 143c1ba8d10bc27500812acd433ffca56110f02c Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sun, 10 Aug 2014 04:01:47 +0200 Subject: [ticket/12957] Removed unused use PHPBB3-12957 --- phpBB/phpbb/template/twig/environment.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php index b3f57b016f..0ba7a265e4 100644 --- a/phpBB/phpbb/template/twig/environment.php +++ b/phpBB/phpbb/template/twig/environment.php @@ -13,9 +13,6 @@ namespace phpbb\template\twig; -use Twig_Lexer; -use Twig_LexerInterface; - class environment extends \Twig_Environment { /** @var \phpbb\config\config */ -- cgit v1.2.1