mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-20 18:32:59 +08:00
Fixes #4820: Fixed reading incomplete debug index data in case of high request concurrency
This commit is contained in:
@ -4,7 +4,7 @@ Yii Framework 2 debug extension Change Log
|
|||||||
2.0.2 under development
|
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
|
2.0.1 December 07, 2014
|
||||||
|
@ -118,7 +118,17 @@ class DefaultController extends Controller
|
|||||||
clearstatcache();
|
clearstatcache();
|
||||||
}
|
}
|
||||||
$indexFile = $this->module->dataPath . '/index.data';
|
$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);
|
$this->_manifest = array_reverse(unserialize($content), true);
|
||||||
} else {
|
} else {
|
||||||
$this->_manifest = [];
|
$this->_manifest = [];
|
||||||
|
Reference in New Issue
Block a user