<?php
require_once dirname(__DIR__) . '/bootstrap/chairman_bootstrap.php';
$raceDate = isset($_GET['race_date']) ? chairman_safe_date($_GET['race_date']) : date('Y-m-d');
$venue = isset($_GET['venue']) ? $_GET['venue'] : '';
$raceNum = isset($_GET['race_num']) ? intval($_GET['race_num']) : 0;
$cache = $Chairman->readCache($raceDate,$venue,$raceNum);
if(!$cache){ chairman_json_response(array('status'=>'CACHE_MISSING','message'=>'Run Chairman/cache/build_today_cache.php first.','race_date'=>$raceDate,'venue'=>$venue,'race_num'=>$raceNum)); }
chairman_json_response(array('status'=>'OK','cache'=>$cache));
