Commit c218ac10a8a53393c8211c0858e74b18ecc638f5
1 parent
9a63b7f6
Exists in
master
and in
112 other branches
if NaN second elem
Showing
1 changed file
with
11 additions
and
8 deletions
Show diff stats
php/classes/FilesMgr.php
... | ... | @@ -254,7 +254,8 @@ class FilesMgr extends AmdaObjectMgr { |
254 | 254 | $StartTime = null; |
255 | 255 | if (!file_exists($this->fileName)) return -100; |
256 | 256 | $i = 0; |
257 | - | |
257 | + $dt = -10; | |
258 | + | |
258 | 259 | $handler = fopen($this->fileName, 'r'); |
259 | 260 | if ($handler) { |
260 | 261 | while (!feof($handler) && !$StartTime) { |
... | ... | @@ -264,10 +265,9 @@ class FilesMgr extends AmdaObjectMgr { |
264 | 265 | $i++; |
265 | 266 | continue; |
266 | 267 | } |
267 | - $StartTime = $time; | |
268 | - if (!(is_numeric($elems[1]))) return -10; | |
269 | - $dt = $elems[1]; | |
270 | - | |
268 | + $StartTime = $time; | |
269 | + if (is_numeric($elems[1])) $dt = $elems[1]; | |
270 | + //else Array for sure !!! | |
271 | 271 | } |
272 | 272 | } |
273 | 273 | |
... | ... | @@ -278,8 +278,11 @@ class FilesMgr extends AmdaObjectMgr { |
278 | 278 | if (count($elems) < 2) return -10; |
279 | 279 | |
280 | 280 | // dT else Array |
281 | - if (!($time = strtotime($elems[0]))) return $dt; | |
282 | - else return $time - $StartTime; | |
281 | + if (!($time = strtotime($elems[0]))) { | |
282 | + return $dt; | |
283 | + } | |
284 | + | |
285 | + return $time - $StartTime; | |
283 | 286 | } |
284 | 287 | |
285 | 288 | |
... | ... | @@ -1160,7 +1163,7 @@ class FilesMgr extends AmdaObjectMgr { |
1160 | 1163 | $this->sampling = $samplings[0]; |
1161 | 1164 | $this->maxSampling = $samplings[1]; |
1162 | 1165 | } |
1163 | - | |
1166 | + | |
1164 | 1167 | if ($this->sampling <= 0) { |
1165 | 1168 | unlink($this->fileName); |
1166 | 1169 | if ($this->sampling == -10) { |
... | ... |