diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2012-12-06 14:26:14 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2012-12-06 14:26:14 +0100 |
commit | b4db9728400f5ec0a40bd62d992cc5a2f4832233 (patch) | |
tree | bff832f39c62157c00fde7af18006a9eb267ad30 /phpBB/includes/cache/driver/file.php | |
parent | 98092add9e1f7fd03e347831b7d0b8db6c92939f (diff) | |
parent | 2364d4b2172c9f54520f04001b29c517d7138b69 (diff) | |
download | forums-b4db9728400f5ec0a40bd62d992cc5a2f4832233.tar forums-b4db9728400f5ec0a40bd62d992cc5a2f4832233.tar.gz forums-b4db9728400f5ec0a40bd62d992cc5a2f4832233.tar.bz2 forums-b4db9728400f5ec0a40bd62d992cc5a2f4832233.tar.xz forums-b4db9728400f5ec0a40bd62d992cc5a2f4832233.zip |
Merge branch 'develop' of https://github.com/phpbb/phpbb3 into ticket/10411-2
* 'develop' of https://github.com/phpbb/phpbb3: (204 commits)
[ticket/11219] Coding guidelines and naming consistency changes
[ticket/10841] Revert more whitespace changes.
[ticket/10841] Revert whitespace changes.
[ticket/10841] adding space after if
[ticket/10841] removing unnecessary spacing
[ticket/10841] changing affectedrows check to COUNT in sql
[ticket/10841] Modifying style and language selectors in UCP
[ticket/11247] Fix wrong property reference in flock class.
[ticket/10602] Avoid a race condition.
[ticket/10602] Use last_queue_run for its intended purpose.
[ticket/10716] Collect standard error from executed php process.
[ticket/10716] Skip test if php is not in PATH.
[ticket/10716] Exclude our dependencies from linting.
[ticket/10103] New and improved wording.
[ticket/10716] Only lint on php 5.3+.
[ticket/10103] Assert with messages.
[ticket/10103] assertLessThan/assertGreaterThan.
[ticket/10103] Inline assignment is bad?
[ticket/10103] $rv had too few characters.
[ticket/10103] Correct flock class documentation.
...
Conflicts:
phpBB/config/services.yml
phpBB/includes/groupposition/legend.php
Diffstat (limited to 'phpBB/includes/cache/driver/file.php')
-rw-r--r-- | phpBB/includes/cache/driver/file.php | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/phpBB/includes/cache/driver/file.php b/phpBB/includes/cache/driver/file.php index 32bdb1918a..691abe0438 100644 --- a/phpBB/includes/cache/driver/file.php +++ b/phpBB/includes/cache/driver/file.php @@ -215,6 +215,7 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base while (($entry = readdir($dir)) !== false) { if (strpos($entry, 'container_') !== 0 && + strpos($entry, 'url_matcher') !== 0 && strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 && @@ -387,10 +388,10 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base if ($this->_write('sql_' . md5($query), $this->sql_rowset[$query_id], $ttl + time(), $query)) { - $query_result = $query_id; + return $query_id; } - return $query_id; + return $query_result; } /** @@ -652,10 +653,11 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base $file = "{$this->cache_dir}$filename.$phpEx"; + $lock = new phpbb_lock_flock($file); + $lock->acquire(); + if ($handle = @fopen($file, 'wb')) { - @flock($handle, LOCK_EX); - // File header fwrite($handle, '<' . '?php exit; ?' . '>'); @@ -696,7 +698,6 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base fwrite($handle, $data); } - @flock($handle, LOCK_UN); fclose($handle); if (!function_exists('phpbb_chmod')) @@ -707,10 +708,16 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base phpbb_chmod($file, CHMOD_READ | CHMOD_WRITE); - return true; + $return_value = true; + } + else + { + $return_value = false; } - return false; + $lock->release(); + + return $return_value; } /** |