mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[feature/template-engine] Extracted compile_stream_to_stream.
PHPBB3-9726
This commit is contained in:
parent
63ca4c2104
commit
d840de560c
1 changed files with 19 additions and 4 deletions
|
@ -883,8 +883,7 @@ class phpbb_template_compile
|
|||
|
||||
@flock($destination_handle, LOCK_EX);
|
||||
|
||||
stream_filter_append($source_handle, 'phpbb_template');
|
||||
stream_copy_to_stream($source_handle, $destination_handle);
|
||||
$this->compile_stream_to_stream($source_handle, $destination_handle);
|
||||
|
||||
@fclose($source_handle);
|
||||
@flock($destination_handle, LOCK_UN);
|
||||
|
@ -914,8 +913,7 @@ class phpbb_template_compile
|
|||
return false;
|
||||
}
|
||||
|
||||
stream_filter_append($source_handle, 'phpbb_template');
|
||||
stream_copy_to_stream($source_handle, $destination_handle);
|
||||
$this->compile_stream_to_stream($source_handle, $destination_handle);
|
||||
|
||||
@fclose($source_handle);
|
||||
|
||||
|
@ -925,4 +923,21 @@ class phpbb_template_compile
|
|||
|
||||
return $contents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compiles contents of $source_stream into $dest_stream.
|
||||
*
|
||||
* A stream filter is appended to $source_stream as part of the
|
||||
* process.
|
||||
*
|
||||
* @access private
|
||||
* @param resource $source_stream Source stream
|
||||
* @param resource $dest_stream Destination stream
|
||||
* @return void
|
||||
*/
|
||||
private function compile_stream_to_stream($source_stream, $dest_stream)
|
||||
{
|
||||
stream_filter_append($source_stream, 'phpbb_template');
|
||||
stream_copy_to_stream($source_stream, $dest_stream);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue