X-Git-Url: http://git.dj3c1t.com/?a=blobdiff_plain;f=app%2Fdata%2Fmodules%2Fxml%2Fsml_data_sources_cache_db.php;h=7496d6bacf06108f417711ca69f59f2ef9a639b2;hb=HEAD;hp=9700fddde1224f55eb362fe88a5270e279886a0a;hpb=7d287d32ecd625ad3c21e9aa2aa122c86f9ec671;p=mw_sourceml diff --git a/app/data/modules/xml/sml_data_sources_cache_db.php b/app/data/modules/xml/sml_data_sources_cache_db.php index 9700fdd..7496d6b 100644 --- a/app/data/modules/xml/sml_data_sources_cache_db.php +++ b/app/data/modules/xml/sml_data_sources_cache_db.php @@ -1,18 +1,17 @@ sgbd(); + public function source_cache_db(){ + $sgbd = $this->sgbd(); $source_cache = array(); - if($rst = $sgbd->open_data("sml_source_cache")) - { while($v_rst = $sgbd->fetch_data($rst)) - { if(isset($v_rst)) - { if(isset($v_rst["id"])) $source_cache[$v_rst["id"]] = $v_rst; + if($rst = $sgbd->open_data("sml_source_cache")){ + while($v_rst = $sgbd->fetch_data($rst)){ + if(isset($v_rst)){ + if(isset($v_rst["id"])) $source_cache[$v_rst["id"]] = $v_rst; } - else - { $source_cache = false; + else{ + $source_cache = false; $break; } } @@ -22,21 +21,21 @@ return $source_cache; } - function source_cache_infos_db($url) - { $sgbd = $this->sgbd(); + public function source_cache_infos_db($url){ + $sgbd = $this->sgbd(); $cache_infos = array(); - if($rst = $sgbd->open_data("sml_source_cache")) - { while($v_rst = $sgbd->fetch_data($rst)) - { if(isset($v_rst)) - { if(isset($v_rst["id"]) && isset($v_rst["url"])) - { if($v_rst["url"] == $url) - { $cache_infos = $v_rst; + if($rst = $sgbd->open_data("sml_source_cache")){ + while($v_rst = $sgbd->fetch_data($rst)){ + if(isset($v_rst)){ + if(isset($v_rst["id"]) && isset($v_rst["url"])){ + if($v_rst["url"] == $url){ + $cache_infos = $v_rst; $break; } } } - else - { $cache_infos = false; + else{ + $cache_infos = false; $break; } } @@ -46,23 +45,21 @@ return $cache_infos; } - function add_source_cache_db($url, $cache_index) - { $sgbd = $this->sgbd(); - return $sgbd->add_data - ( "sml_source_cache", - array - ( "url" => $url, + public function add_source_cache_db($url, $cache_index){ + $sgbd = $this->sgbd(); + return $sgbd->add_data( + "sml_source_cache", + array( + "url" => $url, "id_source" => $cache_index, "last_update" => date("Y-m-d H:i:s") ) ) ? true : false; } - function del_source_cache_db($id_cache_data) - { $sgbd = $this->sgbd(); + public function del_source_cache_db($id_cache_data){ + $sgbd = $this->sgbd(); return $sgbd->del_data("sml_source_cache", $id_cache_data) ? true : false; } } - -?> \ No newline at end of file