3 class sml_data_sources_cache_db extends mw_data
6 function source_cache_db()
7 { $sgbd = $this->sgbd();
8 $source_cache = array();
9 if($rst = $sgbd->open_data("sml_source_cache"))
10 { while($v_rst = $sgbd->fetch_data($rst))
12 { if(isset($v_rst["id"])) $source_cache[$v_rst["id"]] = $v_rst;
15 { $source_cache = false;
19 $sgbd->close_data($rst);
21 else $source_cache = false;
25 function source_cache_infos_db($url)
26 { $sgbd = $this->sgbd();
27 $cache_infos = array();
28 if($rst = $sgbd->open_data("sml_source_cache"))
29 { while($v_rst = $sgbd->fetch_data($rst))
31 { if(isset($v_rst["id"]) && isset($v_rst["url"]))
32 { if($v_rst["url"] == $url)
33 { $cache_infos = $v_rst;
39 { $cache_infos = false;
43 $sgbd->close_data($rst);
45 else $cache_infos = false;
49 function add_source_cache_db($url, $cache_index)
50 { $sgbd = $this->sgbd();
51 return $sgbd->add_data
55 "id_source" => $cache_index,
56 "last_update" => date("Y-m-d H:i:s")
61 function del_source_cache_db($id_cache_data)
62 { $sgbd = $this->sgbd();
63 return $sgbd->del_data("sml_source_cache", $id_cache_data) ? true : false;