Fixes #16752: Fix rotating files under Windows

This commit is contained in:
Alexander Makarov
2018-09-30 20:23:27 +03:00
committed by GitHub
parent 6e02082303
commit 25e6cd45c5
2 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ Yii Framework 2 Change Log
2.0.16 under development 2.0.16 under development
------------------------ ------------------------
- Bug #16752: Fix rotating files under Windows (samdark, nadirvishun)
- Bug #16716: The ability to filter by pressing the Enter key when the option `$filterOnFocusOut` off (s1lver) - Bug #16716: The ability to filter by pressing the Enter key when the option `$filterOnFocusOut` off (s1lver)
- Bug #15791: Added a warning when the form names conflict (s1lver, rustamwin) - Bug #15791: Added a warning when the form names conflict (s1lver, rustamwin)
- Enh #16151: `ActiveQuery::getTableNameAndAlias()` is now protected (s1lver) - Enh #16151: `ActiveQuery::getTableNameAndAlias()` is now protected (s1lver)

View File

@ -115,9 +115,9 @@ class FileTarget extends Target
clearstatcache(); clearstatcache();
} }
if ($this->enableRotation && @filesize($this->logFile) > $this->maxFileSize * 1024) { if ($this->enableRotation && @filesize($this->logFile) > $this->maxFileSize * 1024) {
$this->rotateFiles();
@flock($fp, LOCK_UN); @flock($fp, LOCK_UN);
@fclose($fp); @fclose($fp);
$this->rotateFiles();
$writeResult = @file_put_contents($this->logFile, $text, FILE_APPEND | LOCK_EX); $writeResult = @file_put_contents($this->logFile, $text, FILE_APPEND | LOCK_EX);
if ($writeResult === false) { if ($writeResult === false) {
$error = error_get_last(); $error = error_get_last();