diff --git a/php/classes/FilesMgr.php b/php/classes/FilesMgr.php index 27e37e0..4c63607 100644 --- a/php/classes/FilesMgr.php +++ b/php/classes/FilesMgr.php @@ -254,7 +254,8 @@ class FilesMgr extends AmdaObjectMgr { $StartTime = null; if (!file_exists($this->fileName)) return -100; $i = 0; - + $dt = -10; + $handler = fopen($this->fileName, 'r'); if ($handler) { while (!feof($handler) && !$StartTime) { @@ -264,10 +265,9 @@ class FilesMgr extends AmdaObjectMgr { $i++; continue; } - $StartTime = $time; - if (!(is_numeric($elems[1]))) return -10; - $dt = $elems[1]; - + $StartTime = $time; + if (is_numeric($elems[1])) $dt = $elems[1]; + //else Array for sure !!! } } @@ -278,8 +278,11 @@ class FilesMgr extends AmdaObjectMgr { if (count($elems) < 2) return -10; // dT else Array - if (!($time = strtotime($elems[0]))) return $dt; - else return $time - $StartTime; + if (!($time = strtotime($elems[0]))) { + return $dt; + } + + return $time - $StartTime; } @@ -1160,7 +1163,7 @@ class FilesMgr extends AmdaObjectMgr { $this->sampling = $samplings[0]; $this->maxSampling = $samplings[1]; } - + if ($this->sampling <= 0) { unlink($this->fileName); if ($this->sampling == -10) { -- libgit2 0.21.2