aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/template/compile.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2012-12-09 21:02:31 +0100
committerMarc Alexander <admin@m-a-styles.de>2012-12-09 21:02:31 +0100
commit1aae72961a3205a8487218b6d69361c43a1297d6 (patch)
tree3096a599c14c88084f782022f002ed84224ccf8b /phpBB/includes/template/compile.php
parent26bde05a30c7111b57621a37d86425aa69d74263 (diff)
parent3fe381eed561e724700b21789e28ea3efb1f7ef9 (diff)
downloadforums-1aae72961a3205a8487218b6d69361c43a1297d6.tar
forums-1aae72961a3205a8487218b6d69361c43a1297d6.tar.gz
forums-1aae72961a3205a8487218b6d69361c43a1297d6.tar.bz2
forums-1aae72961a3205a8487218b6d69361c43a1297d6.tar.xz
forums-1aae72961a3205a8487218b6d69361c43a1297d6.zip
Merge branch 'develop' into feature/avatars
Conflicts: phpBB/install/database_update.php
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)
{