aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/template/compile.php
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2012-12-07 21:14:39 -0600
committerNathan Guse <nathaniel.guse@gmail.com>2012-12-07 21:14:39 -0600
commit0042f071476b75258f5f8ea0b5b9fcb445ffde23 (patch)
tree67cbafd7c655ad94809fef5f7dbe3a23525b232b /phpBB/includes/template/compile.php
parentc911a34b5b7541b46ee2408da366d2dc7c302090 (diff)
parentb7b8fefdd084b51c93b15dfdfb34d2ef294f4d76 (diff)
downloadforums-0042f071476b75258f5f8ea0b5b9fcb445ffde23.tar
forums-0042f071476b75258f5f8ea0b5b9fcb445ffde23.tar.gz
forums-0042f071476b75258f5f8ea0b5b9fcb445ffde23.tar.bz2
forums-0042f071476b75258f5f8ea0b5b9fcb445ffde23.tar.xz
forums-0042f071476b75258f5f8ea0b5b9fcb445ffde23.zip
Merge branch 'develop' of github.com:EXreaction/phpbb3 into ticket/11103
Conflicts: phpBB/install/database_update.php phpBB/styles/prosilver/template/ucp_prefs_personal.html phpBB/styles/subsilver2/template/ucp_prefs_personal.html
Diffstat (limited to 'phpBB/includes/template/compile.php')
-rw-r--r--phpBB/includes/template/compile.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/phpBB/includes/template/compile.php b/phpBB/includes/template/compile.php
index 82b301c1a2..22da21820e 100644
--- a/phpBB/includes/template/compile.php
+++ b/phpBB/includes/template/compile.php
@@ -58,6 +58,9 @@ class phpbb_template_compile
*/
public function compile_file_to_file($source_file, $compiled_file)
{
+ $lock = new phpbb_lock_flock($compiled_file);
+ $lock->acquire();
+
$source_handle = @fopen($source_file, 'rb');
$destination_handle = @fopen($compiled_file, 'wb');
@@ -66,16 +69,15 @@ class phpbb_template_compile
return false;
}
- @flock($destination_handle, LOCK_EX);
-
$this->compile_stream_to_stream($source_handle, $destination_handle);
@fclose($source_handle);
- @flock($destination_handle, LOCK_UN);
@fclose($destination_handle);
phpbb_chmod($compiled_file, CHMOD_READ | CHMOD_WRITE);
+ $lock->release();
+
clearstatcache();
return true;
@@ -118,7 +120,7 @@ class phpbb_template_compile
*
* @param resource $source_stream Source stream
* @param resource $dest_stream Destination stream
- * @return void
+ * @return null
*/
private function compile_stream_to_stream($source_stream, $dest_stream)
{