aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/template/twig
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/template/twig')
-rw-r--r--phpBB/phpbb/template/twig/definition.php8
-rw-r--r--phpBB/phpbb/template/twig/environment.php33
-rw-r--r--phpBB/phpbb/template/twig/extension.php68
-rw-r--r--phpBB/phpbb/template/twig/lexer.php12
-rw-r--r--phpBB/phpbb/template/twig/loader.php4
-rw-r--r--phpBB/phpbb/template/twig/node/definenode.php (renamed from phpBB/phpbb/template/twig/node/define.php)10
-rw-r--r--phpBB/phpbb/template/twig/node/event.php10
-rw-r--r--phpBB/phpbb/template/twig/node/expression/binary/equalequal.php6
-rw-r--r--phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php6
-rw-r--r--phpBB/phpbb/template/twig/node/includeasset.php12
-rw-r--r--phpBB/phpbb/template/twig/node/includecss.php6
-rw-r--r--phpBB/phpbb/template/twig/node/includejs.php6
-rw-r--r--phpBB/phpbb/template/twig/node/includenode.php (renamed from phpBB/phpbb/template/twig/node/include.php)6
-rw-r--r--phpBB/phpbb/template/twig/node/includephp.php10
-rw-r--r--phpBB/phpbb/template/twig/node/php.php8
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/defineparser.php (renamed from phpBB/phpbb/template/twig/tokenparser/define.php)18
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/event.php10
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/includecss.php10
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/includejs.php10
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/includeparser.php (renamed from phpBB/phpbb/template/twig/tokenparser/include.php)8
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/includephp.php14
-rw-r--r--phpBB/phpbb/template/twig/tokenparser/php.php14
-rw-r--r--phpBB/phpbb/template/twig/twig.php60
23 files changed, 198 insertions, 151 deletions
diff --git a/phpBB/phpbb/template/twig/definition.php b/phpBB/phpbb/template/twig/definition.php
index 6557b209eb..2490a43f81 100644
--- a/phpBB/phpbb/template/twig/definition.php
+++ b/phpBB/phpbb/template/twig/definition.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig;
+
/**
* @ignore
*/
@@ -18,7 +20,7 @@ if (!defined('IN_PHPBB'))
/**
* This class holds all DEFINE variables from the current page load
*/
-class phpbb_template_twig_definition
+class definition
{
/** @var array **/
protected $definitions = array();
@@ -39,7 +41,7 @@ class phpbb_template_twig_definition
*
* @param string $name
* @param mixed $value
- * @return phpbb_template_twig_definition
+ * @return \phpbb\template\twig\definition
*/
public function set($name, $value)
{
@@ -53,7 +55,7 @@ class phpbb_template_twig_definition
*
* @param string $name
* @param string $value
- * @return phpbb_template_twig_definition
+ * @return \phpbb\template\twig\definition
*/
public function append($name, $value)
{
diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php
index 612519db69..a6c0e476f0 100644
--- a/phpBB/phpbb/template/twig/environment.php
+++ b/phpBB/phpbb/template/twig/environment.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig;
+
/**
* @ignore
*/
@@ -15,16 +17,16 @@ if (!defined('IN_PHPBB'))
exit;
}
-class phpbb_template_twig_environment extends Twig_Environment
+class environment extends \Twig_Environment
{
/** @var array */
protected $phpbb_extensions;
- /** @var phpbb_config */
+ /** @var \phpbb\config\config */
protected $phpbb_config;
- /** @var phpbb_filesystem */
- protected $phpbb_filesystem;
+ /** @var \phpbb\path_helper */
+ protected $phpbb_path_helper;
/** @var string */
protected $phpbb_root_path;
@@ -38,20 +40,21 @@ class phpbb_template_twig_environment extends Twig_Environment
/**
* Constructor
*
- * @param phpbb_config $phpbb_config
+ * @param \phpbb\config\config $phpbb_config
* @param array $phpbb_extensions Array of enabled extensions (name => path)
+ * @param \phpbb\path_helper
* @param string $phpbb_root_path
* @param Twig_LoaderInterface $loader
* @param array $options Array of options to pass to Twig
*/
- public function __construct($phpbb_config, $phpbb_extensions, phpbb_filesystem $phpbb_filesystem, Twig_LoaderInterface $loader = null, $options = array())
+ public function __construct($phpbb_config, $phpbb_extensions, \phpbb\path_helper $path_helper, \Twig_LoaderInterface $loader = null, $options = array())
{
$this->phpbb_config = $phpbb_config;
$this->phpbb_extensions = $phpbb_extensions;
- $this->phpbb_filesystem = $phpbb_filesystem;
- $this->phpbb_root_path = $this->phpbb_filesystem->get_phpbb_root_path();
- $this->web_root_path = $this->phpbb_filesystem->get_web_root_path();
+ $this->phpbb_path_helper = $path_helper;
+ $this->phpbb_root_path = $this->phpbb_path_helper->get_phpbb_root_path();
+ $this->web_root_path = $this->phpbb_path_helper->get_web_root_path();
return parent::__construct($loader, $options);
}
@@ -71,7 +74,7 @@ class phpbb_template_twig_environment extends Twig_Environment
/**
* Get phpBB config
*
- * @return phpbb_config
+ * @return \phpbb\config\config
*/
public function get_phpbb_config()
{
@@ -99,13 +102,13 @@ class phpbb_template_twig_environment extends Twig_Environment
}
/**
- * Get the phpbb_filesystem object
+ * Get the phpbb path helper object
*
- * @return phpbb_filesystem
+ * @return \phpbb\path_helper
*/
- public function get_filesystem()
+ public function get_path_helper()
{
- return $this->phpbb_filesystem;
+ return $this->phpbb_path_helper;
}
/**
@@ -153,7 +156,7 @@ class phpbb_template_twig_environment extends Twig_Environment
return parent::loadTemplate('@' . $namespace . '/' . $name, $index);
}
- catch (Twig_Error_Loader $e)
+ catch (\Twig_Error_Loader $e)
{
}
}
diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php
index c279726434..1ddb97369e 100644
--- a/phpBB/phpbb/template/twig/extension.php
+++ b/phpBB/phpbb/template/twig/extension.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig;
+
/**
* @ignore
*/
@@ -15,22 +17,22 @@ if (!defined('IN_PHPBB'))
exit;
}
-class phpbb_template_twig_extension extends Twig_Extension
+class extension extends \Twig_Extension
{
- /** @var phpbb_template_context */
+ /** @var \phpbb\template\context */
protected $context;
- /** @var phpbb_user */
+ /** @var \phpbb\user */
protected $user;
/**
* Constructor
*
- * @param phpbb_template_context $context
- * @param phpbb_user $user
- * @return phpbb_template_twig_extension
+ * @param \phpbb\template\context $context
+ * @param \phpbb\user $user
+ * @return \phpbb\template\twig\extension
*/
- public function __construct(phpbb_template_context $context, $user)
+ public function __construct(\phpbb\template\context $context, $user)
{
$this->context = $context;
$this->user = $user;
@@ -54,13 +56,13 @@ class phpbb_template_twig_extension extends Twig_Extension
public function getTokenParsers()
{
return array(
- new phpbb_template_twig_tokenparser_define,
- new phpbb_template_twig_tokenparser_include,
- new phpbb_template_twig_tokenparser_includejs,
- new phpbb_template_twig_tokenparser_includecss,
- new phpbb_template_twig_tokenparser_event,
- new phpbb_template_twig_tokenparser_includephp,
- new phpbb_template_twig_tokenparser_php,
+ new \phpbb\template\twig\tokenparser\defineparser,
+ new \phpbb\template\twig\tokenparser\includeparser,
+ new \phpbb\template\twig\tokenparser\includejs,
+ new \phpbb\template\twig\tokenparser\includecss,
+ new \phpbb\template\twig\tokenparser\event,
+ new \phpbb\template\twig\tokenparser\includephp,
+ new \phpbb\template\twig\tokenparser\php,
);
}
@@ -72,8 +74,8 @@ class phpbb_template_twig_extension extends Twig_Extension
public function getFilters()
{
return array(
- new Twig_SimpleFilter('subset', array($this, 'loop_subset'), array('needs_environment' => true)),
- new Twig_SimpleFilter('addslashes', 'addslashes'),
+ new \Twig_SimpleFilter('subset', array($this, 'loop_subset'), array('needs_environment' => true)),
+ new \Twig_SimpleFilter('addslashes', 'addslashes'),
);
}
@@ -85,7 +87,7 @@ class phpbb_template_twig_extension extends Twig_Extension
public function getFunctions()
{
return array(
- new Twig_SimpleFunction('lang', array($this, 'lang')),
+ new \Twig_SimpleFunction('lang', array($this, 'lang')),
);
}
@@ -102,26 +104,26 @@ class phpbb_template_twig_extension extends Twig_Extension
),
array(
// precedence settings are copied from similar operators in Twig core extension
- '||' => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- '&&' => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
+ '||' => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ '&&' => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
- 'eq' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Equal', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
+ 'eq' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Equal', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
- 'ne' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- 'neq' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- '<>' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
+ 'ne' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ 'neq' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ '<>' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
- '===' => array('precedence' => 20, 'class' => 'phpbb_template_twig_node_expression_binary_equalequal', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- '!==' => array('precedence' => 20, 'class' => 'phpbb_template_twig_node_expression_binary_notequalequal', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
+ '===' => array('precedence' => 20, 'class' => '\phpbb\template\twig\node\expression\binary\equalequal', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ '!==' => array('precedence' => 20, 'class' => '\phpbb\template\twig\node\expression\binary\notequalequal', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
- 'gt' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Greater', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- 'gte' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- 'ge' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- 'lt' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Less', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- 'lte' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- 'le' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
+ 'gt' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Greater', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ 'gte' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ 'ge' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ 'lt' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Less', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ 'lte' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ 'le' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
- 'mod' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mod', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
+ 'mod' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mod', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
),
);
}
@@ -137,7 +139,7 @@ class phpbb_template_twig_extension extends Twig_Extension
*
* @return mixed The sliced variable
*/
- function loop_subset(Twig_Environment $env, $item, $start, $end = null, $preserveKeys = false)
+ function loop_subset(\Twig_Environment $env, $item, $start, $end = null, $preserveKeys = false)
{
// We do almost the same thing as Twig's slice (array_slice), except when $end is positive
if ($end >= 1)
diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php
index 16a693cd7c..d832fbf84e 100644
--- a/phpBB/phpbb/template/twig/lexer.php
+++ b/phpBB/phpbb/template/twig/lexer.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig;
+
/**
* @ignore
*/
@@ -15,7 +17,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-class phpbb_template_twig_lexer extends Twig_Lexer
+class lexer extends \Twig_Lexer
{
public function tokenize($code, $filename = null)
{
@@ -229,18 +231,18 @@ class phpbb_template_twig_lexer extends Twig_Lexer
{
$inner = $matches[2];
// Replace $TEST with definition.TEST
- $inner = preg_replace('#(\s\(?!?)\$([a-zA-Z_0-9]+)#', '$1definition.$2', $inner);
+ $inner = preg_replace('#(\s\(*!?)\$([a-zA-Z_0-9]+)#', '$1definition.$2', $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);
+ $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);
+ $inner = preg_replace('#(\s\(*!?)\.([a-zA-Z_0-9\.]+)([^a-zA-Z_0-9\.])#', '$1$2|length$3', $inner);
return "<!-- {$matches[1]}IF{$inner}-->";
};
- return preg_replace_callback('#<!-- (ELSE)?IF((.*?) \(?!?[\$|\.]([^\s]+)(.*?))-->#', $callback, $code);
+ return preg_replace_callback('#<!-- (ELSE)?IF((.*?) \(*!?[\$|\.]([^\s]+)(.*?))-->#', $callback, $code);
}
/**
diff --git a/phpBB/phpbb/template/twig/loader.php b/phpBB/phpbb/template/twig/loader.php
index 0829e519f7..910061dc0f 100644
--- a/phpBB/phpbb/template/twig/loader.php
+++ b/phpBB/phpbb/template/twig/loader.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig;
+
/**
* @ignore
*/
@@ -19,7 +21,7 @@ if (!defined('IN_PHPBB'))
* Twig Template loader
* @package phpBB3
*/
-class phpbb_template_twig_loader extends Twig_Loader_Filesystem
+class loader extends \Twig_Loader_Filesystem
{
protected $safe_directories = array();
diff --git a/phpBB/phpbb/template/twig/node/define.php b/phpBB/phpbb/template/twig/node/definenode.php
index fcb19cc773..ec084d0f7d 100644
--- a/phpBB/phpbb/template/twig/node/define.php
+++ b/phpBB/phpbb/template/twig/node/definenode.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\node;
+
/**
* @ignore
*/
@@ -16,9 +18,9 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_node_define extends Twig_Node
+class definenode extends \Twig_Node
{
- public function __construct($capture, Twig_NodeInterface $name, Twig_NodeInterface $value, $lineno, $tag = null)
+ public function __construct($capture, \Twig_NodeInterface $name, \Twig_NodeInterface $value, $lineno, $tag = null)
{
parent::__construct(array('name' => $name, 'value' => $value), array('capture' => $capture, 'safe' => false), $lineno, $tag);
}
@@ -28,7 +30,7 @@ class phpbb_template_twig_node_define extends Twig_Node
*
* @param Twig_Compiler A Twig_Compiler instance
*/
- public function compile(Twig_Compiler $compiler)
+ public function compile(\Twig_Compiler $compiler)
{
$compiler->addDebugInfo($this);
@@ -38,7 +40,7 @@ class phpbb_template_twig_node_define extends Twig_Node
->subcompile($this->getNode('value'))
;
- $compiler->write("\$value = ('' === \$value = ob_get_clean()) ? '' : new Twig_Markup(\$value, \$this->env->getCharset());\n");
+ $compiler->write("\$value = ('' === \$value = ob_get_clean()) ? '' : new \Twig_Markup(\$value, \$this->env->getCharset());\n");
}
else
{
diff --git a/phpBB/phpbb/template/twig/node/event.php b/phpBB/phpbb/template/twig/node/event.php
index c94e5fdf20..202db775ee 100644
--- a/phpBB/phpbb/template/twig/node/event.php
+++ b/phpBB/phpbb/template/twig/node/event.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\node;
+
/**
* @ignore
*/
@@ -16,9 +18,9 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_node_event extends Twig_Node
+class event extends \Twig_Node
{
- /**
+ /**
* The subdirectory in which all template listener files must be placed
* @var string
*/
@@ -27,7 +29,7 @@ class phpbb_template_twig_node_event extends Twig_Node
/** @var Twig_Environment */
protected $environment;
- public function __construct(Twig_Node_Expression $expr, phpbb_template_twig_environment $environment, $lineno, $tag = null)
+ public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $tag = null)
{
$this->environment = $environment;
@@ -39,7 +41,7 @@ class phpbb_template_twig_node_event extends Twig_Node
*
* @param Twig_Compiler A Twig_Compiler instance
*/
- public function compile(Twig_Compiler $compiler)
+ public function compile(\Twig_Compiler $compiler)
{
$compiler->addDebugInfo($this);
diff --git a/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php b/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php
index 8ec2069114..48d8b814b8 100644
--- a/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php
+++ b/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\node\expression\binary;
+
/**
* @ignore
*/
@@ -16,9 +18,9 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_node_expression_binary_equalequal extends Twig_Node_Expression_Binary
+class equalequal extends \Twig_Node_Expression_Binary
{
- public function operator(Twig_Compiler $compiler)
+ public function operator(\Twig_Compiler $compiler)
{
return $compiler->raw('===');
}
diff --git a/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php b/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php
index 96f32c502e..87585dfb4c 100644
--- a/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php
+++ b/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\node\expression\binary;
+
/**
* @ignore
*/
@@ -16,9 +18,9 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_node_expression_binary_notequalequal extends Twig_Node_Expression_Binary
+class notequalequal extends \Twig_Node_Expression_Binary
{
- public function operator(Twig_Compiler $compiler)
+ public function operator(\Twig_Compiler $compiler)
{
return $compiler->raw('!==');
}
diff --git a/phpBB/phpbb/template/twig/node/includeasset.php b/phpBB/phpbb/template/twig/node/includeasset.php
index 8629395898..f6c9dc9c58 100644
--- a/phpBB/phpbb/template/twig/node/includeasset.php
+++ b/phpBB/phpbb/template/twig/node/includeasset.php
@@ -7,12 +7,14 @@
*
*/
-abstract class phpbb_template_twig_node_includeasset extends Twig_Node
+namespace phpbb\template\twig\node;
+
+abstract class includeasset extends \Twig_Node
{
/** @var Twig_Environment */
protected $environment;
- public function __construct(Twig_Node_Expression $expr, phpbb_template_twig_environment $environment, $lineno, $tag = null)
+ public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $tag = null)
{
$this->environment = $environment;
@@ -23,7 +25,7 @@ abstract class phpbb_template_twig_node_includeasset extends Twig_Node
*
* @param Twig_Compiler A Twig_Compiler instance
*/
- public function compile(Twig_Compiler $compiler)
+ public function compile(\Twig_Compiler $compiler)
{
$compiler->addDebugInfo($this);
@@ -33,7 +35,7 @@ abstract class phpbb_template_twig_node_includeasset extends Twig_Node
->write("\$asset_file = ")
->subcompile($this->getNode('expr'))
->raw(";\n")
- ->write("\$asset = new phpbb_template_asset(\$asset_file, \$this->getEnvironment()->get_filesystem());\n")
+ ->write("\$asset = new \phpbb\\template\\asset(\$asset_file, \$this->getEnvironment()->get_path_helper());\n")
->write("if (substr(\$asset_file, 0, 2) !== './' && \$asset->is_relative()) {\n")
->indent()
->write("\$asset_path = \$asset->get_path();")
@@ -71,5 +73,5 @@ abstract class phpbb_template_twig_node_includeasset extends Twig_Node
* @param Twig_Compiler A Twig_Compiler instance
* @return null
*/
- abstract protected function append_asset(Twig_Compiler $compiler);
+ abstract protected function append_asset(\Twig_Compiler $compiler);
}
diff --git a/phpBB/phpbb/template/twig/node/includecss.php b/phpBB/phpbb/template/twig/node/includecss.php
index a9d9b46d69..deb279fa4a 100644
--- a/phpBB/phpbb/template/twig/node/includecss.php
+++ b/phpBB/phpbb/template/twig/node/includecss.php
@@ -7,7 +7,9 @@
*
*/
-class phpbb_template_twig_node_includecss extends phpbb_template_twig_node_includeasset
+namespace phpbb\template\twig\node;
+
+class includecss extends \phpbb\template\twig\node\includeasset
{
/**
* {@inheritdoc}
@@ -20,7 +22,7 @@ class phpbb_template_twig_node_includecss extends phpbb_template_twig_node_inclu
/**
* {@inheritdoc}
*/
- public function append_asset(Twig_Compiler $compiler)
+ public function append_asset(\Twig_Compiler $compiler)
{
$compiler
->raw("<link href=\"' . ")
diff --git a/phpBB/phpbb/template/twig/node/includejs.php b/phpBB/phpbb/template/twig/node/includejs.php
index 2b4b55fb0a..696b640eac 100644
--- a/phpBB/phpbb/template/twig/node/includejs.php
+++ b/phpBB/phpbb/template/twig/node/includejs.php
@@ -7,7 +7,9 @@
*
*/
-class phpbb_template_twig_node_includejs extends phpbb_template_twig_node_includeasset
+namespace phpbb\template\twig\node;
+
+class includejs extends \phpbb\template\twig\node\includeasset
{
/**
* {@inheritdoc}
@@ -20,7 +22,7 @@ class phpbb_template_twig_node_includejs extends phpbb_template_twig_node_includ
/**
* {@inheritdoc}
*/
- protected function append_asset(Twig_Compiler $compiler)
+ protected function append_asset(\Twig_Compiler $compiler)
{
$config = $this->environment->get_phpbb_config();
diff --git a/phpBB/phpbb/template/twig/node/include.php b/phpBB/phpbb/template/twig/node/includenode.php
index 5c6ae1bbcf..77fe7f3acb 100644
--- a/phpBB/phpbb/template/twig/node/include.php
+++ b/phpBB/phpbb/template/twig/node/includenode.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\node;
+
/**
* @ignore
*/
@@ -16,14 +18,14 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_node_include extends Twig_Node_Include
+class includenode extends \Twig_Node_Include
{
/**
* Compiles the node to PHP.
*
* @param Twig_Compiler A Twig_Compiler instance
*/
- public function compile(Twig_Compiler $compiler)
+ public function compile(\Twig_Compiler $compiler)
{
$compiler->addDebugInfo($this);
diff --git a/phpBB/phpbb/template/twig/node/includephp.php b/phpBB/phpbb/template/twig/node/includephp.php
index dbe54f0e1a..4024cf0cc8 100644
--- a/phpBB/phpbb/template/twig/node/includephp.php
+++ b/phpBB/phpbb/template/twig/node/includephp.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\node;
+
/**
* @ignore
*/
@@ -16,12 +18,12 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_node_includephp extends Twig_Node
+class includephp extends \Twig_Node
{
/** @var Twig_Environment */
protected $environment;
- public function __construct(Twig_Node_Expression $expr, phpbb_template_twig_environment $environment, $ignoreMissing = false, $lineno, $tag = null)
+ public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $ignoreMissing = false, $lineno, $tag = null)
{
$this->environment = $environment;
@@ -33,7 +35,7 @@ class phpbb_template_twig_node_includephp extends Twig_Node
*
* @param Twig_Compiler A Twig_Compiler instance
*/
- public function compile(Twig_Compiler $compiler)
+ public function compile(\Twig_Compiler $compiler)
{
$compiler->addDebugInfo($this);
@@ -80,7 +82,7 @@ class phpbb_template_twig_node_includephp extends Twig_Node
if ($this->getAttribute('ignore_missing')) {
$compiler
->outdent()
- ->write("} catch (Twig_Error_Loader \$e) {\n")
+ ->write("} catch (\Twig_Error_Loader \$e) {\n")
->indent()
->write("// ignore missing template\n")
->outdent()
diff --git a/phpBB/phpbb/template/twig/node/php.php b/phpBB/phpbb/template/twig/node/php.php
index c11539ea7f..b37759303d 100644
--- a/phpBB/phpbb/template/twig/node/php.php
+++ b/phpBB/phpbb/template/twig/node/php.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\node;
+
/**
* @ignore
*/
@@ -16,12 +18,12 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_node_php extends Twig_Node
+class php extends \Twig_Node
{
/** @var Twig_Environment */
protected $environment;
- public function __construct(Twig_Node_Text $text, phpbb_template_twig_environment $environment, $lineno, $tag = null)
+ public function __construct(\Twig_Node_Text $text, \phpbb\template\twig\environment $environment, $lineno, $tag = null)
{
$this->environment = $environment;
@@ -33,7 +35,7 @@ class phpbb_template_twig_node_php extends Twig_Node
*
* @param Twig_Compiler A Twig_Compiler instance
*/
- public function compile(Twig_Compiler $compiler)
+ public function compile(\Twig_Compiler $compiler)
{
$compiler->addDebugInfo($this);
diff --git a/phpBB/phpbb/template/twig/tokenparser/define.php b/phpBB/phpbb/template/twig/tokenparser/defineparser.php
index 4ea15388c4..688afec191 100644
--- a/phpBB/phpbb/template/twig/tokenparser/define.php
+++ b/phpBB/phpbb/template/twig/tokenparser/defineparser.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\tokenparser;
+
/**
* @ignore
*/
@@ -16,7 +18,7 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_tokenparser_define extends Twig_TokenParser
+class defineparser extends \Twig_TokenParser
{
/**
* Parses a token and returns a node.
@@ -25,31 +27,31 @@ class phpbb_template_twig_tokenparser_define extends Twig_TokenParser
*
* @return Twig_NodeInterface A Twig_NodeInterface instance
*/
- public function parse(Twig_Token $token)
+ public function parse(\Twig_Token $token)
{
$lineno = $token->getLine();
$stream = $this->parser->getStream();
$name = $this->parser->getExpressionParser()->parseExpression();
$capture = false;
- if ($stream->test(Twig_Token::OPERATOR_TYPE, '=')) {
+ if ($stream->test(\Twig_Token::OPERATOR_TYPE, '=')) {
$stream->next();
$value = $this->parser->getExpressionParser()->parseExpression();
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
} else {
$capture = true;
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
$value = $this->parser->subparse(array($this, 'decideBlockEnd'), true);
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
}
- return new phpbb_template_twig_node_define($capture, $name, $value, $lineno, $this->getTag());
+ return new \phpbb\template\twig\node\definenode($capture, $name, $value, $lineno, $this->getTag());
}
- public function decideBlockEnd(Twig_Token $token)
+ public function decideBlockEnd(\Twig_Token $token)
{
return $token->test('ENDDEFINE');
}
diff --git a/phpBB/phpbb/template/twig/tokenparser/event.php b/phpBB/phpbb/template/twig/tokenparser/event.php
index e4dddd6dcc..7cf4000909 100644
--- a/phpBB/phpbb/template/twig/tokenparser/event.php
+++ b/phpBB/phpbb/template/twig/tokenparser/event.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\tokenparser;
+
/**
* @ignore
*/
@@ -16,7 +18,7 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_tokenparser_event extends Twig_TokenParser
+class event extends \Twig_TokenParser
{
/**
* Parses a token and returns a node.
@@ -25,14 +27,14 @@ class phpbb_template_twig_tokenparser_event extends Twig_TokenParser
*
* @return Twig_NodeInterface A Twig_NodeInterface instance
*/
- public function parse(Twig_Token $token)
+ public function parse(\Twig_Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
$stream = $this->parser->getStream();
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
- return new phpbb_template_twig_node_event($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
+ return new \phpbb\template\twig\node\event($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
}
/**
diff --git a/phpBB/phpbb/template/twig/tokenparser/includecss.php b/phpBB/phpbb/template/twig/tokenparser/includecss.php
index 6c24dda647..7bf4c610b1 100644
--- a/phpBB/phpbb/template/twig/tokenparser/includecss.php
+++ b/phpBB/phpbb/template/twig/tokenparser/includecss.php
@@ -7,7 +7,9 @@
*
*/
-class phpbb_template_twig_tokenparser_includecss extends Twig_TokenParser
+namespace phpbb\template\twig\tokenparser;
+
+class includecss extends \Twig_TokenParser
{
/**
* Parses a token and returns a node.
@@ -16,14 +18,14 @@ class phpbb_template_twig_tokenparser_includecss extends Twig_TokenParser
*
* @return Twig_NodeInterface A Twig_NodeInterface instance
*/
- public function parse(Twig_Token $token)
+ public function parse(\Twig_Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
$stream = $this->parser->getStream();
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
- return new phpbb_template_twig_node_includecss($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
+ return new \phpbb\template\twig\node\includecss($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
}
/**
diff --git a/phpBB/phpbb/template/twig/tokenparser/includejs.php b/phpBB/phpbb/template/twig/tokenparser/includejs.php
index b02b2f89ba..30a99f3279 100644
--- a/phpBB/phpbb/template/twig/tokenparser/includejs.php
+++ b/phpBB/phpbb/template/twig/tokenparser/includejs.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\tokenparser;
+
/**
* @ignore
*/
@@ -16,7 +18,7 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_tokenparser_includejs extends Twig_TokenParser
+class includejs extends \Twig_TokenParser
{
/**
* Parses a token and returns a node.
@@ -25,14 +27,14 @@ class phpbb_template_twig_tokenparser_includejs extends Twig_TokenParser
*
* @return Twig_NodeInterface A Twig_NodeInterface instance
*/
- public function parse(Twig_Token $token)
+ public function parse(\Twig_Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
$stream = $this->parser->getStream();
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
- return new phpbb_template_twig_node_includejs($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
+ return new \phpbb\template\twig\node\includejs($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
}
/**
diff --git a/phpBB/phpbb/template/twig/tokenparser/include.php b/phpBB/phpbb/template/twig/tokenparser/includeparser.php
index 520f9fd1a0..715c0ec84d 100644
--- a/phpBB/phpbb/template/twig/tokenparser/include.php
+++ b/phpBB/phpbb/template/twig/tokenparser/includeparser.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\tokenparser;
+
/**
* @ignore
*/
@@ -16,7 +18,7 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_tokenparser_include extends Twig_TokenParser_Include
+class includeparser extends \Twig_TokenParser_Include
{
/**
* Parses a token and returns a node.
@@ -25,13 +27,13 @@ class phpbb_template_twig_tokenparser_include extends Twig_TokenParser_Include
*
* @return Twig_NodeInterface A Twig_NodeInterface instance
*/
- public function parse(Twig_Token $token)
+ public function parse(\Twig_Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
list($variables, $only, $ignoreMissing) = $this->parseArguments();
- return new phpbb_template_twig_node_include($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag());
+ return new \phpbb\template\twig\node\includenode($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag());
}
/**
diff --git a/phpBB/phpbb/template/twig/tokenparser/includephp.php b/phpBB/phpbb/template/twig/tokenparser/includephp.php
index 13fe6de8a6..d906837590 100644
--- a/phpBB/phpbb/template/twig/tokenparser/includephp.php
+++ b/phpBB/phpbb/template/twig/tokenparser/includephp.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\tokenparser;
+
/**
* @ignore
*/
@@ -16,7 +18,7 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_tokenparser_includephp extends Twig_TokenParser
+class includephp extends \Twig_TokenParser
{
/**
* Parses a token and returns a node.
@@ -25,23 +27,23 @@ class phpbb_template_twig_tokenparser_includephp extends Twig_TokenParser
*
* @return Twig_NodeInterface A Twig_NodeInterface instance
*/
- public function parse(Twig_Token $token)
+ public function parse(\Twig_Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
$stream = $this->parser->getStream();
$ignoreMissing = false;
- if ($stream->test(Twig_Token::NAME_TYPE, 'ignore')) {
+ if ($stream->test(\Twig_Token::NAME_TYPE, 'ignore')) {
$stream->next();
- $stream->expect(Twig_Token::NAME_TYPE, 'missing');
+ $stream->expect(\Twig_Token::NAME_TYPE, 'missing');
$ignoreMissing = true;
}
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
- return new phpbb_template_twig_node_includephp($expr, $this->parser->getEnvironment(), $ignoreMissing, $token->getLine(), $this->getTag());
+ return new \phpbb\template\twig\node\includephp($expr, $this->parser->getEnvironment(), $ignoreMissing, $token->getLine(), $this->getTag());
}
/**
diff --git a/phpBB/phpbb/template/twig/tokenparser/php.php b/phpBB/phpbb/template/twig/tokenparser/php.php
index 197980a59a..e4f70fb9b1 100644
--- a/phpBB/phpbb/template/twig/tokenparser/php.php
+++ b/phpBB/phpbb/template/twig/tokenparser/php.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\tokenparser;
+
/**
* @ignore
*/
@@ -16,7 +18,7 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_tokenparser_php extends Twig_TokenParser
+class php extends \Twig_TokenParser
{
/**
* Parses a token and returns a node.
@@ -25,20 +27,20 @@ class phpbb_template_twig_tokenparser_php extends Twig_TokenParser
*
* @return Twig_NodeInterface A Twig_NodeInterface instance
*/
- public function parse(Twig_Token $token)
+ public function parse(\Twig_Token $token)
{
$stream = $this->parser->getStream();
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
$body = $this->parser->subparse(array($this, 'decideEnd'), true);
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
- return new phpbb_template_twig_node_php($body, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
+ return new \phpbb\template\twig\node\php($body, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
}
- public function decideEnd(Twig_Token $token)
+ public function decideEnd(\Twig_Token $token)
{
return $token->test('ENDPHP');
}
diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php
index 3aa063ffc6..9df9310427 100644
--- a/phpBB/phpbb/template/twig/twig.php
+++ b/phpBB/phpbb/template/twig/twig.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig;
+
/**
* @ignore
*/
@@ -19,7 +21,7 @@ if (!defined('IN_PHPBB'))
* Twig Template class.
* @package phpBB3
*/
-class phpbb_template_twig extends phpbb_template_base
+class twig extends \phpbb\template\base
{
/**
* Path of the cache directory for the template
@@ -31,10 +33,10 @@ class phpbb_template_twig extends phpbb_template_base
private $cachepath = '';
/**
- * phpBB filesystem
- * @var phpbb_filesystem
+ * phpBB path helper
+ * @var \phpbb\path_helper
*/
- protected $phpbb_filesystem;
+ protected $path_helper;
/**
* phpBB root path
@@ -50,20 +52,20 @@ class phpbb_template_twig extends phpbb_template_base
/**
* phpBB config instance
- * @var phpbb_config
+ * @var \phpbb\config\config
*/
protected $config;
/**
* Current user
- * @var phpbb_user
+ * @var \phpbb\user
*/
protected $user;
/**
* Extension manager.
*
- * @var phpbb_extension_manager
+ * @var \phpbb\extension\manager
*/
protected $extension_manager;
@@ -77,17 +79,17 @@ class phpbb_template_twig extends phpbb_template_base
/**
* Constructor.
*
- * @param phpbb_filesystem $phpbb_filesystem
- * @param phpbb_config $config
- * @param phpbb_user $user
- * @param phpbb_template_context $context template context
- * @param phpbb_extension_manager $extension_manager extension manager, if null then template events will not be invoked
+ * @param \phpbb\path_helper $path_helper
+ * @param \phpbb\config\config $config
+ * @param \phpbb\user $user
+ * @param \phpbb\template\context $context template context
+ * @param \phpbb\extension\manager $extension_manager extension manager, if null then template events will not be invoked
*/
- public function __construct(phpbb_filesystem $phpbb_filesystem, $config, $user, phpbb_template_context $context, phpbb_extension_manager $extension_manager = null)
+ public function __construct(\phpbb\path_helper $path_helper, $config, $user, \phpbb\template\context $context, \phpbb\extension\manager $extension_manager = null)
{
- $this->phpbb_filesystem = $phpbb_filesystem;
- $this->phpbb_root_path = $phpbb_filesystem->get_phpbb_root_path();
- $this->php_ext = $phpbb_filesystem->get_php_ext();
+ $this->path_helper = $path_helper;
+ $this->phpbb_root_path = $path_helper->get_phpbb_root_path();
+ $this->php_ext = $path_helper->get_php_ext();
$this->config = $config;
$this->user = $user;
$this->context = $context;
@@ -96,12 +98,12 @@ class phpbb_template_twig extends phpbb_template_base
$this->cachepath = $this->phpbb_root_path . 'cache/twig/';
// Initiate the loader, __main__ namespace paths will be setup later in set_style_names()
- $loader = new phpbb_template_twig_loader('');
+ $loader = new \phpbb\template\twig\loader('');
- $this->twig = new phpbb_template_twig_environment(
+ $this->twig = new \phpbb\template\twig\environment(
$this->config,
($this->extension_manager) ? $this->extension_manager->all_enabled() : array(),
- $this->phpbb_filesystem,
+ $this->path_helper,
$loader,
array(
'cache' => (defined('IN_INSTALL')) ? false : $this->cachepath,
@@ -112,27 +114,27 @@ class phpbb_template_twig extends phpbb_template_base
);
$this->twig->addExtension(
- new phpbb_template_twig_extension(
+ new \phpbb\template\twig\extension(
$this->context,
$this->user
)
);
- $lexer = new phpbb_template_twig_lexer($this->twig);
+ $lexer = new \phpbb\template\twig\lexer($this->twig);
$this->twig->setLexer($lexer);
// Add admin namespace
- if ($this->phpbb_filesystem->get_adm_relative_path() !== null && is_dir($this->phpbb_root_path . $this->phpbb_filesystem->get_adm_relative_path() . 'style/'))
+ if ($this->path_helper->get_adm_relative_path() !== null && is_dir($this->phpbb_root_path . $this->path_helper->get_adm_relative_path() . 'style/'))
{
- $this->twig->getLoader()->setPaths($this->phpbb_root_path . $this->phpbb_filesystem->get_adm_relative_path() . 'style/', 'admin');
+ $this->twig->getLoader()->setPaths($this->phpbb_root_path . $this->path_helper->get_adm_relative_path() . 'style/', 'admin');
}
}
/**
* Clear the cache
*
- * @return phpbb_template
+ * @return \phpbb\template\template
*/
public function clear_cache()
{
@@ -169,7 +171,7 @@ class phpbb_template_twig extends phpbb_template_base
* @param array $style_directories The directories to add style paths for
* E.g. array('ext/foo/bar/styles', 'styles')
* Default: array('styles') (phpBB's style directory)
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function set_style($style_directories = array('styles'))
{
@@ -230,7 +232,7 @@ class phpbb_template_twig extends phpbb_template_base
$this->twig->getLoader()->setPaths($paths);
// Add all namespaces for all extensions
- if ($this->extension_manager instanceof phpbb_extension_manager)
+ if ($this->extension_manager instanceof \phpbb\extension\manager)
{
$names[] = 'all';
@@ -269,7 +271,7 @@ class phpbb_template_twig extends phpbb_template_base
* This function calls hooks.
*
* @param string $handle Handle to display
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function display($handle)
{
@@ -291,7 +293,7 @@ class phpbb_template_twig extends phpbb_template_base
* @param string $handle Handle to operate on
* @param string $template_var Template variable to assign compiled handle to
* @param bool $return_content If true return compiled handle, otherwise assign to $template_var
- * @return phpbb_template|string if $return_content is true return string of the compiled handle, otherwise return $this
+ * @return \phpbb\template\template|string if $return_content is true return string of the compiled handle, otherwise return $this
*/
public function assign_display($handle, $template_var = '', $return_content = true)
{
@@ -317,7 +319,7 @@ class phpbb_template_twig extends phpbb_template_base
$vars = array_merge(
$context_vars['.'][0], // To get normal vars
array(
- 'definition' => new phpbb_template_twig_definition(),
+ 'definition' => new \phpbb\template\twig\definition(),
'user' => $this->user,
'loops' => $context_vars, // To get loops
)