init();
$service = new Service();
$service->id = "minetest";
$service->token = "45678-hsjsndjs-272892-shgdzusjd-6788";
$user = new User();
$user->id = "bananafish";
$user->serial = '0C:87:64:78';
$user->cert = "Yee Haw";
$grant = new Grant();
$grant->id = uniqid();
$grant->service = $service;
$ticket = new Ticket();
$ticket->id = uniqid();
$ticket->start = 1471111;
$ticket->end = 1474567;
$ticket->user = $user;
$ticket->grant = $grant;
$ticket->groups[] = new User();
$ticket->groups[0]->id = 'baaaa';
$ticket->groups[0]->cert = 'Cat';
$database->save($service);
$database->save($user);
$database->save($grant);
$database->save($ticket);
$database->save($ticket->groups[0]);
echo('Start Time in microseconds: ' . microtime(true) . '
');
echo($ticket->Serialize(true, false, $database));
echo('
');
echo(var_dump(Ticket::Deserialize($ticket->Serialize(true), true)));
echo('
');
echo(Ticket::Deserialize($ticket->Serialize(true), true))->Serialize(true);
echo('
');
echo($ticket->Serialize(false, false, $database));
echo('
');
echo(var_dump(Ticket::Deserialize($ticket->Serialize(false), false, $database)));
echo('
');
echo(Ticket::Deserialize($ticket->Serialize(false), false, $database))->Serialize(false);
echo('