} $endtime = time() + $globalCronEnd; $i = 1; $tt = 0; // Delete all ATC if (!$globalDaemon && isset($globalIVAO) && $globalIVAO) { $ATC->deleteAll(); } // Infinite loop if daemon, else work for time defined in $globalCronEnd or only one time. while ($i > 0) { if (!$globalDaemon) { $i = $endtime - time(); } // Delete old ATC if ($globalDaemon && isset($globalIVAO) && $globalIVAO) { $ATC->deleteOldAtc(); } foreach ($formats as $id => $value) { if ($value == 'deltadbtxt' && time() - $last_exec['deltadbtxt'] > $globalMinFetch) { $buffer = $Common->getData($hosts[$id]); $buffer = trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '\\n', $buffer)); $buffer = explode('\\n', $buffer); foreach ($buffer as $line) { if ($line != '') { $line = explode(',', $line); $data = array(); $data['hex'] = $line[1]; // hex $data['ident'] = $line[2]; // ident $data['altitude'] = $line[3];
$globalCronEnd = 60; } $endtime = time() + $globalCronEnd; $lastsend = time(); $i = 1; $tt = 0; // Delete old ATC if (!$globalDaemon && $globalIVAO) { ATC::deleteAll(); } while ($i > 0) { if (!$globalDaemon) { $i = $endtime - time(); } if ($globalDaemon && $globalIVAO) { ATC::deleteOldAtc(); } foreach ($formats as $id => $value) { if ($value == 'deltadbtxt') { $buffer = Common::getData($hosts[$id]); $buffer = trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '\\n', $buffer)); $buffer = explode('\\n', $buffer); foreach ($buffer as $line) { if ($line != '') { $line = explode(',', $line); $data = array(); $data['hex'] = $line[1]; // hex $data['ident'] = $line[2]; // ident $data['altitude'] = $line[3];