Commit c808932c by Alexander Makarov

Fixes #4820: Fixed reading incomplete debug index data in case of high request concurrency

parent 2aa39499
......@@ -4,7 +4,7 @@ Yii Framework 2 debug extension Change Log
2.0.2 under development
-----------------------
- no changes in this release.
- Bug #4820: Fixed reading incomplete debug index data in case of high request concurrency (martingeorg, samdark)
2.0.1 December 07, 2014
......
......@@ -118,7 +118,17 @@ class DefaultController extends Controller
clearstatcache();
}
$indexFile = $this->module->dataPath . '/index.data';
if (is_file($indexFile) && is_readable($indexFile) && ($content = file_get_contents($indexFile)) !== false) {
$content = '';
$fp = @fopen($indexFile, 'r');
if ($fp !== false) {
@flock($fp, LOCK_SH);
$content = fread($fp, filesize($indexFile));
@flock($fp, LOCK_UN);
fclose($fp);
}
if ($content !== '') {
$this->_manifest = array_reverse(unserialize($content), true);
} else {
$this->_manifest = [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment