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.
19 lines
428 B
PHP
19 lines
428 B
PHP
<?php
|
|
|
|
$ReflectorStatus = (file_exists($Service['PIDFile'])) ? 'up' : 'down';
|
|
|
|
$payload = array(
|
|
'lastupdate' => gmdate('U', time()),
|
|
'lasturfdupdate' => gmdate('U', filemtime($Service['XMLFile'])),
|
|
'reflectorstatus' => $ReflectorStatus,
|
|
'reflectoruptimeseconds' => $Reflector->GetServiceUptime()
|
|
);
|
|
|
|
|
|
// json encode payload array
|
|
$records = json_encode($payload);
|
|
|
|
echo $records;
|
|
|
|
?>
|