3 class mw_data_check_instance extends mw_data{
5 function check_instance(){
6 // return $this->check_instance_normalise_config();
10 function check_instance_normalise_config(){
12 if($env->bdd("sgbd") == "xml"){
13 debug("start normalise config");
15 $sgbd = $data->sgbd();
18 if($rst = $sgbd->open_data("config")){
19 while($v_rst = $sgbd->fetch_data($rst)){
21 $erreur = "erreur lors de la lecture de la configuration (check_instance)";
24 if(!isset($v_rst["key"]) || !isset($v_rst["value"])){
25 foreach($v_rst as $config_key => $config_value){
26 $configs[$v_rst["id"]] = array(
28 "value" => $config_value
34 $sgbd->close_data($rst);
36 else return "impossible de lire la configuration (check_instance)";
37 if($erreur) return $erreur;
38 foreach($configs as $config_id => $config){
39 if(!$sgbd->set_data("config", $config_id, $config)){
40 return "erreur lors de l'enregistrement de la configuration";
43 return "end normalise config";