Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'upstream/master' into stat-relation-bugfix

Conflicts:
	CHANGELOG
  • Loading branch information...
commit 21c5ad387c2146e2b7a2a373baae09c808bd537a 2 parents b25d90b + cfa8fd3
@Yiivgeny Yiivgeny authored
View
1  CHANGELOG
@@ -15,6 +15,7 @@ Version 1.1.14 work in progress
- Bug #1996: Using yiic help for commands with parameters with array as default value resulted in PHP error with latest PHP versions (dInGd0nG, samdark)
- Bug #2030: Fixed problem with MySQL 4.x: Undefined Index: Comment in CMysqlSchema (cebe)
- Bug #2049: CStatElement relation with join option throw exception when key-field present on joined table (Yiivgeny)
+- Enh: Better CFileLogRoute performance (Qiang, samdark)
- Enh #1847: Added COutputCache::varyByLanguage to generate separate cache for different languages (Obramko)
- Enh #2038: CFormatter::formatNtext() method can replace newlines with `<p></p>` not just with `<br />` as it was before (resurtm)
- Chg #645: CDbConnection now throws CDbException when failed to open DB connection instead of failing with a warning (kidol, eirikhm, samdark, cebe)
View
19 framework/logging/CFileLogRoute.php
@@ -135,15 +135,26 @@ public function setMaxLogFiles($value)
*/
protected function processLogs($logs)
{
+ $text='';
+ foreach($logs as $log)
+ $text.=$this->formatLogMessage($log[0],$log[1],$log[2],$log[3]);
+
$logFile=$this->getLogPath().DIRECTORY_SEPARATOR.$this->getLogFile();
$fp=@fopen($logFile,'a');
@flock($fp,LOCK_EX);
if(@filesize($logFile)>$this->getMaxFileSize()*1024)
+ {
$this->rotateFiles();
- foreach($logs as $log)
- @fwrite($fp,$this->formatLogMessage($log[0],$log[1],$log[2],$log[3]));
- @flock($fp,LOCK_UN);
- @fclose($fp);
+ @flock($fp,LOCK_UN);
+ @fclose($fp);
+ @file_put_contents($logFile,$text,FILE_APPEND|LOCK_EX);
+ }
+ else
+ {
+ @fwrite($fp,$text);
+ @flock($fp,LOCK_UN);
+ @fclose($fp);
+ }
}
/**
View
2  framework/utils/CVarDumper.php
@@ -121,7 +121,7 @@ private static function dumpInternal($var,$level)
self::$_output.=get_class($var).'(...)';
else
{
- $id=self::$_objects[]=$var;
+ $id=array_push(self::$_objects,$var);
$className=get_class($var);
$members=(array)$var;
$spaces=str_repeat(' ',$level*4);
Please sign in to comment.
Something went wrong with that request. Please try again.