Пример #1
0
function init_events()
{
    $serverTimeFormat = "\\I\\t \\i\\s g:i a T \\o\\n l, F jS \\o\\f Y";
    $uptime = `uptime`;
    $events = new events();
    $parts = explode("average: ", $uptime, 2);
    $load = $parts[count($parts) - 1];
    //Keep Alive Ping
    $pingData = ["id" => uniqid("kuhl-"), "server-time" => date($serverTimeFormat), "server-load" => $load, "server" => $_SERVER];
    $events->add("ping", $pingData);
    //Send Pending Events for Session
    $events->sendEvents();
}