upgrade 0.11.2 pour XML, MySql et SQLite
[mtweb] / mw / env / modules / mw_env_config.php
index a708431..fcb85f2 100644 (file)
@@ -51,7 +51,7 @@
       if(isset($app_config["subs"]["bdd"][0]["subs"]["table_prefix_code"])){
         $this->add_table_prefix(
           array(
-            $app_config["subs"]["bdd"][0]["subs"]["table_prefix_code"][0]["data"] => $bdd["table_prefix"]
+            $app_config["subs"]["bdd"][0]["subs"]["table_prefix_code"][0]["data"] => isset($bdd["table_prefix"]) ? $bdd["table_prefix"] : ""
           )
         );
       }
       $this->bdd[$key] = $value;
     }
 
+    function bdd_ready(){
+      if(!$this->bdd("sgbd")) return "aucun sgbd defini";
+      $data = $this->data();
+      if(!$data) return "objet data non defini";
+      if(($res = $this->data_upgrade_required()) !== false){
+        if($res === true){
+          return "la base de donnees doit etre mise a jour";
+        }
+        else return $res;
+      }
+      return true;
+    }
+
     function add_table_prefix($table_prefix){
       if(is_array($table_prefix)){
         foreach($table_prefix as $prefix_code => $prefix) $this->bdd["table_prefix"][$prefix_code] = $prefix;