$timestamp, 'timestampLocal' => $host_ts, 'duration' => $host_uptime, 'users' => $host_users, 'load1' => $host_load1, 'load5' => $host_load5, 'load15' => $host_load15 ); $uptime = new XML_RPC_Value($hostInfo, 'struct'); return new XML_RPC_Response($uptime); } // method metainfo $hostUptime_sig = array(array($XML_RPC_Struct)); $hostUptime_doc = 'Returns the uptime information of the host,' .' and a timestamp (UTC timezone) when the' .' measure was made.'; // dispatch map $map = array ( 'method.serverUptime' => array ( 'function' => 'hostUptime', 'signature' => $hostUptime_sig, 'docstring' => $hostUptime_doc ) ); // start server $server = new XML_RPC_Server($map); $server->service(); ?>