<?php include "helper.php"; isRequestValid(function () { mutateData(function ($old) { $old->last_ping = time(); return $old; }); echo "Pong!"; });
<?php include "helper.php"; isRequestValid(function () { mutateData(function ($old) { if (!isset($old->infractions)) { $old->infractions = []; } $old->infractions[] = ['time' => time(), 'power' => $_GET['power']]; return $old; }); echo "Recorded!"; });