"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "framework/log/FileTarget.php" between
yii2-2.0.35.tar.gz and yii2-2.0.36.tar.gz

About: Yii 2 is a high-performance component-based PHP framework for developing large-scale Web applications (source).

FileTarget.php  (yii2-2.0.35):FileTarget.php  (yii2-2.0.36)
skipping to change at line 125 skipping to change at line 125
// this may result in rotating twice when cached file size is used o n subsequent calls // this may result in rotating twice when cached file size is used o n subsequent calls
clearstatcache(); clearstatcache();
} }
if ($this->enableRotation && @filesize($this->logFile) > $this->maxFileS ize * 1024) { if ($this->enableRotation && @filesize($this->logFile) > $this->maxFileS ize * 1024) {
@flock($fp, LOCK_UN); @flock($fp, LOCK_UN);
@fclose($fp); @fclose($fp);
$this->rotateFiles(); $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();
throw new LogRuntimeException("Unable to export log through file !: {$error['message']}"); throw new LogRuntimeException("Unable to export log through file ({$this->logFile})!: {$error['message']}");
} }
$textSize = strlen($text); $textSize = strlen($text);
if ($writeResult < $textSize) { if ($writeResult < $textSize) {
throw new LogRuntimeException("Unable to export whole log throug h file! Wrote $writeResult out of $textSize bytes."); throw new LogRuntimeException("Unable to export whole log throug h file ({$this->logFile})! Wrote $writeResult out of $textSize bytes.");
} }
} else { } else {
$writeResult = @fwrite($fp, $text); $writeResult = @fwrite($fp, $text);
if ($writeResult === false) { if ($writeResult === false) {
$error = error_get_last(); $error = error_get_last();
throw new LogRuntimeException("Unable to export log through file !: {$error['message']}"); throw new LogRuntimeException("Unable to export log through file ({$this->logFile})!: {$error['message']}");
} }
$textSize = strlen($text); $textSize = strlen($text);
if ($writeResult < $textSize) { if ($writeResult < $textSize) {
throw new LogRuntimeException("Unable to export whole log throug h file! Wrote $writeResult out of $textSize bytes."); throw new LogRuntimeException("Unable to export whole log throug h file ({$this->logFile})! Wrote $writeResult out of $textSize bytes.");
} }
@flock($fp, LOCK_UN); @flock($fp, LOCK_UN);
@fclose($fp); @fclose($fp);
} }
if ($this->fileMode !== null) { if ($this->fileMode !== null) {
@chmod($this->logFile, $this->fileMode); @chmod($this->logFile, $this->fileMode);
} }
} }
/** /**
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)