Browse Source

Fixes #999.

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
89394db017
  1. 6
      framework/yii/debug/LogTarget.php

6
framework/yii/debug/LogTarget.php

@ -45,7 +45,7 @@ class LogTarget extends Target
if (!is_dir($path)) { if (!is_dir($path)) {
mkdir($path); mkdir($path);
} }
$indexFile = "$path/index.php"; $indexFile = "$path/index.data";
if (!is_file($indexFile)) { if (!is_file($indexFile)) {
$manifest = array(); $manifest = array();
} else { } else {
@ -62,7 +62,7 @@ class LogTarget extends Target
); );
$this->gc($manifest); $this->gc($manifest);
$dataFile = "$path/{$this->tag}.php"; $dataFile = "$path/{$this->tag}.data";
$data = array(); $data = array();
foreach ($this->module->panels as $id => $panel) { foreach ($this->module->panels as $id => $panel) {
$data[$id] = $panel->save(); $data[$id] = $panel->save();
@ -93,7 +93,7 @@ class LogTarget extends Target
if (count($manifest) > $this->module->historySize + 10) { if (count($manifest) > $this->module->historySize + 10) {
$n = count($manifest) - $this->module->historySize; $n = count($manifest) - $this->module->historySize;
foreach (array_keys($manifest) as $tag) { foreach (array_keys($manifest) as $tag) {
$file = $this->module->dataPath . "/$tag.php"; $file = $this->module->dataPath . "/$tag.data";
@unlink($file); @unlink($file);
unset($manifest[$tag]); unset($manifest[$tag]);
if (--$n <= 0) { if (--$n <= 0) {

Loading…
Cancel
Save