Commit 5b86ec97 by Eugene Kuzminov

debug panel : changed .json to .php

parent b9de474c
...@@ -45,7 +45,7 @@ class LogTarget extends Target ...@@ -45,7 +45,7 @@ class LogTarget extends Target
if (!is_dir($path)) { if (!is_dir($path)) {
mkdir($path); mkdir($path);
} }
$indexFile = "$path/index.json"; $indexFile = "$path/index.php";
if (!is_file($indexFile)) { if (!is_file($indexFile)) {
$manifest = array(); $manifest = array();
} else { } else {
...@@ -62,7 +62,7 @@ class LogTarget extends Target ...@@ -62,7 +62,7 @@ class LogTarget extends Target
); );
$this->gc($manifest); $this->gc($manifest);
$dataFile = "$path/{$this->tag}.json"; $dataFile = "$path/{$this->tag}.php";
$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 ...@@ -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.json"; $file = $this->module->dataPath . "/$tag.php";
@unlink($file); @unlink($file);
unset($manifest[$tag]); unset($manifest[$tag]);
if (--$n <= 0) { if (--$n <= 0) {
......
...@@ -74,7 +74,7 @@ class DefaultController extends Controller ...@@ -74,7 +74,7 @@ class DefaultController extends Controller
protected function getManifest() protected function getManifest()
{ {
if ($this->_manifest === null) { if ($this->_manifest === null) {
$indexFile = $this->module->dataPath . '/index.json'; $indexFile = $this->module->dataPath . '/index.php';
if (is_file($indexFile)) { if (is_file($indexFile)) {
$this->_manifest = array_reverse(unserialize(file_get_contents($indexFile)), true); $this->_manifest = array_reverse(unserialize(file_get_contents($indexFile)), true);
} else { } else {
...@@ -88,7 +88,7 @@ class DefaultController extends Controller ...@@ -88,7 +88,7 @@ class DefaultController extends Controller
{ {
$manifest = $this->getManifest(); $manifest = $this->getManifest();
if (isset($manifest[$tag])) { if (isset($manifest[$tag])) {
$dataFile = $this->module->dataPath . "/$tag.json"; $dataFile = $this->module->dataPath . "/$tag.php";
$data = unserialize(file_get_contents($dataFile)); $data = unserialize(file_get_contents($dataFile));
foreach ($this->module->panels as $id => $panel) { foreach ($this->module->panels as $id => $panel) {
if (isset($data[$id])) { if (isset($data[$id])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment