public static function close() { if (!is_null(self::$DBH)) { //print("Closing database<br>"); self::$DBH = null; } }
} if (!$_REQUEST['node_id']) { exit(1); } $matches = null; if (!preg_match("/^([\\d]{1,5},?){1,20}\$/", $_REQUEST['node_id'], $matches)) { exit(1); } $tab = clean_request($_REQUEST['node_id']); if (!$tab) { print "Empty tab<br>"; exit(1); } ShoCKDB_db::$db_backend = 'sqlite'; ShoCKDB_db::$db_path = 'data/feedNodi.sl3'; $db = new ShoCKDB_db(); if (!$db->open()) { print "Impossible d'ouvrir la db!<br>"; exit(1); } header('Content-Type: application/json'); $res = new ShoCKDB_response($db); for ($i = 0; $i < sizeof($tab); $i++) { //print "id: " . $tab[$i] . "<br>"; $node_id = $tab[$i]; if (!$res->get_node(array('node_id' => $node_id))) { print $res->to_json(); exit(1); } } print $res->to_json();