<?php require_once __DIR__ . "/../util/api.php"; require_once __DIR__ . "/../util/imuSearch.php"; require_once __DIR__ . "/../config.php"; $server = emuServer(); $port = emuPort(); $search = new imuSearch($server, $port); try { $search->connect(); } catch (Exception $e) { sendError(503); } if (isset($_GET["irn"])) { $irn = $_GET["irn"]; } else { sendError(400); } $columns = array("image.resource{source:master}"); $terms = array("irn", "{$irn}"); try { $res = $search->search("ecatalogue", $columns, $terms); } catch (Exception $e) { //echo "$e"; sendError(406); } if (isset($res->rows[0]["image"]["resource"])) { $img = $res->rows[0]["image"]["resource"]; } else { sendError(404); }
<?php require_once __DIR__ . "/../util/api.php"; require_once __DIR__ . "/../util/imuSearch.php"; require_once __DIR__ . "/../config.php"; $server = emuServer(); $port = emuPort(); $search = new imuSearch($server, $port); try { $search->connect(); } catch (Exception $e) { sendError(503); } if (isset($_GET["irn"])) { $irn = $_GET["irn"]; } else { sendError(400); } $columns = array("resource"); $terms = array("irn", "{$irn}"); try { $res = $search->search("emultimedia", $columns, $terms); } catch (Exception $e) { //echo $e; sendError(406); } if (isset($res->rows[0]["resource"])) { $media = $res->rows[0]["resource"]; } else { sendError(404); }