3 class sml_data_sources_cache_db extends mw_data{
5 public function source_cache_db(){
7 $source_cache = array();
8 if($rst = $sgbd->open_data("sml_source_cache")){
9 while($v_rst = $sgbd->fetch_data($rst)){
11 if(isset($v_rst["id"])) $source_cache[$v_rst["id"]] = $v_rst;
14 $source_cache = false;
18 $sgbd->close_data($rst);
20 else $source_cache = false;
24 public function source_cache_infos_db($url){
25 $sgbd = $this->sgbd();
26 $cache_infos = array();
27 if($rst = $sgbd->open_data("sml_source_cache")){
28 while($v_rst = $sgbd->fetch_data($rst)){
30 if(isset($v_rst["id"]) && isset($v_rst["url"])){
31 if($v_rst["url"] == $url){
32 $cache_infos = $v_rst;
42 $sgbd->close_data($rst);
44 else $cache_infos = false;
48 public function add_source_cache_db($url, $cache_index){
49 $sgbd = $this->sgbd();
50 return $sgbd->add_data(
54 "id_source" => $cache_index,
55 "last_update" => date("Y-m-d H:i:s")
60 public function del_source_cache_db($id_cache_data){
61 $sgbd = $this->sgbd();
62 return $sgbd->del_data("sml_source_cache", $id_cache_data) ? true : false;