diff options
Diffstat (limited to 'phpBB/phpbb/template/twig/node')
| -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.php | 10 | ||||
| -rw-r--r-- | phpBB/phpbb/template/twig/node/expression/binary/equalequal.php | 6 | ||||
| -rw-r--r-- | phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php | 6 | ||||
| -rw-r--r-- | phpBB/phpbb/template/twig/node/includeasset.php | 16 | ||||
| -rw-r--r-- | phpBB/phpbb/template/twig/node/includecss.php | 6 | ||||
| -rw-r--r-- | phpBB/phpbb/template/twig/node/includejs.php | 6 | ||||
| -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.php | 10 | ||||
| -rw-r--r-- | phpBB/phpbb/template/twig/node/php.php | 8 | 
10 files changed, 52 insertions, 32 deletions
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 1cab416c79..f15fd6296b 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,17 +35,17 @@ 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);\n") +			->write("\$asset = new \phpbb\\template\\asset(\$asset_file, \$this->getEnvironment()->get_filesystem());\n")  			->write("if (substr(\$asset_file, 0, 2) !== './' && \$asset->is_relative()) {\n")  			->indent()  				->write("\$asset_path = \$asset->get_path();")  				->write("\$local_file = \$this->getEnvironment()->get_phpbb_root_path() . \$asset_path;\n")  				->write("if (!file_exists(\$local_file)) {\n")  				->indent() -					->write("\$local_file = \$this->getEnvironment()->getLoader()->getCacheKey(\$asset_path);\n") +					->write("\$local_file = \$this->getEnvironment()->findTemplate(\$asset_path);\n")  					->write("\$asset->set_path(\$local_file, true);\n")  				->outdent() -				->write("\$asset->add_assets_version({$config['assets_version']});\n") +				->write("\$asset->add_assets_version('{$config['assets_version']}');\n")  				->write("\$asset_file = \$asset->get_url();\n")  				->write("}\n")  			->outdent() @@ -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);  | 
