diff options
| author | Igor Wiedler <igor@wiedler.ch> | 2011-07-16 15:23:25 +0200 | 
|---|---|---|
| committer | Igor Wiedler <igor@wiedler.ch> | 2011-07-16 15:24:14 +0200 | 
| commit | bf34264f4f6c0fe6bbe49c6537c0f384f9fc495b (patch) | |
| tree | 4b1539d80b3690508a8b926a0e310e44d114a031 | |
| parent | e43d8732d40eecc7f709cdda048ffb6e388710db (diff) | |
| download | forums-bf34264f4f6c0fe6bbe49c6537c0f384f9fc495b.tar forums-bf34264f4f6c0fe6bbe49c6537c0f384f9fc495b.tar.gz forums-bf34264f4f6c0fe6bbe49c6537c0f384f9fc495b.tar.bz2 forums-bf34264f4f6c0fe6bbe49c6537c0f384f9fc495b.tar.xz forums-bf34264f4f6c0fe6bbe49c6537c0f384f9fc495b.zip | |
[feature/template-engine] Docblocks, no more constructor for filter
Add docblocks for phpbb_template_filter, remove the useless constructor.
PHPBB3-9726
| -rw-r--r-- | phpBB/includes/template/filter.php | 24 | 
1 files changed, 18 insertions, 6 deletions
| diff --git a/phpBB/includes/template/filter.php b/phpBB/includes/template/filter.php index 42700500a7..499a2a0d6b 100644 --- a/phpBB/includes/template/filter.php +++ b/phpBB/includes/template/filter.php @@ -72,11 +72,12 @@ class phpbb_template_filter extends php_user_filter  	*/  	private $allow_php; -	public function __construct($allow_php) -	{ -		$this->allow_php = $allow_php; -	} - +	/** +	* Stream filter +	* +	* 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)  	{  		$written = false; @@ -119,6 +120,12 @@ class phpbb_template_filter extends php_user_filter  		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()  	{  		$this->chunk = ''; @@ -194,6 +201,9 @@ class phpbb_template_filter extends php_user_filter  		return $data;  	} +	/** +	* Callback for replacing matched tokens with PHP code +	*/  	private function replace($matches)  	{  		if ($this->in_php && $matches[1] != 'ENDPHP') @@ -635,7 +645,9 @@ class phpbb_template_filter extends php_user_filter  		return $tokens;  	} - +	/** +	* Compile IF tags +	*/  	private function compile_tag_if($tag_args, $elseif)  	{  		$tokens = $this->compile_expression($tag_args); | 
