. */ require('include/api_key.php'); require('include/tmdb_interface.php'); require('include/local_cache.php'); function log_errors($args) { echo "
"; foreach (func_get_args() as $arg) print_r($arg); echo ""; } function sanitize($str) { $verboten = ['/',"\\",'\'','"']; $str = str_replace($verboten, '', $str); $str = trim(str_replace('.', ' ', strtolower($str))); return $str; } function main(&$local_cache, &$tmdb_interface, &$cache_results, &$is_cached, $query_str, $key) { if ($query_str == '') return; $cache_results = $local_cache->search_movie_by_name($query_str); $is_cached = ($cache_results !== null); if (!$is_cached) { $parsed = $tmdb_interface->query('search/movie', $key, $query_str); if (!$tmdb_interface->errors && $parsed) $cache_results = $local_cache->insert_query_cache($query_str, $parsed); } } $raw_str = @$_GET['tmdb_query']; $query_str = sanitize($raw_str); $lc = new local_cache(); $tmdb = new tmdb_interface(); $data = null; $is_cached = false; main($lc, $tmdb, $data, $is_cached, $query_str, $API_KEY); ?>
time: "" timestamp: "" key: "" raw str: "" query str: "" request str: "request_str; ?>" cache hit: "" query_duration: "query_duration; ?>s"
headers); ?>
info); ?>
body_json); ?>