Browse Source

Fixes #16752: Fix rotating files under Windows

tags/2.0.16
Alexander Makarov 6 years ago committed by GitHub
parent
commit
25e6cd45c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      framework/CHANGELOG.md
  2. 2
      framework/log/FileTarget.php

1
framework/CHANGELOG.md

@ -4,6 +4,7 @@ Yii Framework 2 Change Log
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 #15791: Added a warning when the form names conflict (s1lver, rustamwin)
- Enh #16151: `ActiveQuery::getTableNameAndAlias()` is now protected (s1lver)

2
framework/log/FileTarget.php

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

Loading…
Cancel
Save