aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2014-08-10 10:23:28 +0200
committerMarc Alexander <admin@m-a-styles.de>2014-08-10 10:23:28 +0200
commit3450b793e7645d2590a9164c8f1d9d05df94e77e (patch)
tree009f28dd5eb0d1f4125e186a30af68f997ce7e51 /phpBB/phpbb
parentab2878b37b711c0eb2faed4f7b2db55145b7044c (diff)
parent143c1ba8d10bc27500812acd433ffca56110f02c (diff)
downloadforums-3450b793e7645d2590a9164c8f1d9d05df94e77e.tar
forums-3450b793e7645d2590a9164c8f1d9d05df94e77e.tar.gz
forums-3450b793e7645d2590a9164c8f1d9d05df94e77e.tar.bz2
forums-3450b793e7645d2590a9164c8f1d9d05df94e77e.tar.xz
forums-3450b793e7645d2590a9164c8f1d9d05df94e77e.zip
Merge pull request #2859 from Nicofuma/ticket/12957
[ticket/12957] Update the constructions of the template engine
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/template/twig/environment.php4
-rw-r--r--phpBB/phpbb/template/twig/lexer.php5
2 files changed, 6 insertions, 3 deletions
diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php
index f6d9b73178..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 */
@@ -79,6 +76,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