aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2011-05-01 03:28:53 -0400
committerOleg Pudeyev <oleg@bsdpower.com>2011-05-01 03:28:53 -0400
commitd840de560cc59cd9b6c7da7b794dc3b2756e7377 (patch)
treee96c190437b113ba6eb10d68351659f868bf04a2
parent63ca4c2104e7c61b6f2238b13bd5428b579be9e7 (diff)
downloadforums-d840de560cc59cd9b6c7da7b794dc3b2756e7377.tar
forums-d840de560cc59cd9b6c7da7b794dc3b2756e7377.tar.gz
forums-d840de560cc59cd9b6c7da7b794dc3b2756e7377.tar.bz2
forums-d840de560cc59cd9b6c7da7b794dc3b2756e7377.tar.xz
forums-d840de560cc59cd9b6c7da7b794dc3b2756e7377.zip
[feature/template-engine] Extracted compile_stream_to_stream.
PHPBB3-9726
-rw-r--r--phpBB/includes/template_compile.php23
1 files changed, 19 insertions, 4 deletions
diff --git a/phpBB/includes/template_compile.php b/phpBB/includes/template_compile.php
index e2bb9fd869..dfbf578b58 100644
--- a/phpBB/includes/template_compile.php
+++ b/phpBB/includes/template_compile.php
@@ -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);
+ }
}