mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[feature/template-engine] Docblocks, no more constructor for filter
Add docblocks for phpbb_template_filter, remove the useless constructor. PHPBB3-9726
This commit is contained in:
parent
e43d8732d4
commit
bf34264f4f
1 changed files with 18 additions and 6 deletions
|
@ -72,11 +72,12 @@ class phpbb_template_filter extends php_user_filter
|
||||||
*/
|
*/
|
||||||
private $allow_php;
|
private $allow_php;
|
||||||
|
|
||||||
public function __construct($allow_php)
|
/**
|
||||||
{
|
* Stream filter
|
||||||
$this->allow_php = $allow_php;
|
*
|
||||||
}
|
* Is invoked for evey chunk of the stream, allowing us
|
||||||
|
* to work on a chunk at a time, which saves memory.
|
||||||
|
*/
|
||||||
public function filter($in, $out, &$consumed, $closing)
|
public function filter($in, $out, &$consumed, $closing)
|
||||||
{
|
{
|
||||||
$written = false;
|
$written = false;
|
||||||
|
@ -119,6 +120,12 @@ class phpbb_template_filter extends php_user_filter
|
||||||
return $written ? PSFS_PASS_ON : PSFS_FEED_ME;
|
return $written ? PSFS_PASS_ON : PSFS_FEED_ME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializer, called on creation.
|
||||||
|
*
|
||||||
|
* Get the allow_php option from params, which is passed
|
||||||
|
* to stream_filter_append.
|
||||||
|
*/
|
||||||
public function onCreate()
|
public function onCreate()
|
||||||
{
|
{
|
||||||
$this->chunk = '';
|
$this->chunk = '';
|
||||||
|
@ -194,6 +201,9 @@ class phpbb_template_filter extends php_user_filter
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback for replacing matched tokens with PHP code
|
||||||
|
*/
|
||||||
private function replace($matches)
|
private function replace($matches)
|
||||||
{
|
{
|
||||||
if ($this->in_php && $matches[1] != 'ENDPHP')
|
if ($this->in_php && $matches[1] != 'ENDPHP')
|
||||||
|
@ -635,7 +645,9 @@ class phpbb_template_filter extends php_user_filter
|
||||||
return $tokens;
|
return $tokens;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compile IF tags
|
||||||
|
*/
|
||||||
private function compile_tag_if($tag_args, $elseif)
|
private function compile_tag_if($tag_args, $elseif)
|
||||||
{
|
{
|
||||||
$tokens = $this->compile_expression($tag_args);
|
$tokens = $this->compile_expression($tag_args);
|
||||||
|
|
Loading…
Add table
Reference in a new issue