mirror of
https://github.com/nostar/urfd.git
synced 2026-11-08 04:19:39 +00:00
Found an issue where timezone could be incorrect in api if server admin changes server timezeone to localtime instead of UTC.
24 lines
719 B
PHP
24 lines
719 B
PHP
<?php
|
|
|
|
/*** Add links to payload ***/
|
|
for ($i=0;$i<$Reflector->NodeCount();$i++) {
|
|
|
|
// craft payload array
|
|
$payload[$i] = array(
|
|
'callsign' => $Reflector->Nodes[$i]->GetCallSign() . ' ' . $Reflector->Nodes[$i]->GetSuffix(),
|
|
'ip' => $Reflector->Nodes[$i]->GetIP(),
|
|
'linkedmodule' => $Reflector->Nodes[$i]->GetLinkedModule(),
|
|
'protocol' => $Reflector->Nodes[$i]->GetProtocol(),
|
|
'connecttime' => gmdate('Y-m-d\TH:i:sp', $Reflector->Nodes[$i]->GetConnectTime()),
|
|
'lastheardtime' => gmdate('Y-m-d\TH:i:sp', $Reflector->Nodes[$i]->GetLastHeardTime())
|
|
);
|
|
|
|
}
|
|
|
|
|
|
// json encode payload array
|
|
$records = json_encode($payload);
|
|
|
|
echo $records;
|
|
|
|
?>
|