- if(!class_exists($sgbd_impl)) require_once $this->app_file("data/impl/".$sgbd_impl.".php");
- if(class_exists($sgbd_impl)){
- if(($plugins = $this->plugins("DESC")) !== false){
- $data = new mw_data(true);
- foreach($plugins as $plugin_name => $plugin){
- if($plugin["installed"] && $plugin["enabled"]){
- $data->load_modules($this->path("mw_dir")."plugins/".$plugin_name."/app/", "data/modules/share/");
- $data->load_modules($this->path("mw_dir")."plugins/".$plugin_name."/app/", "data/modules/".($this->bdd("sgbd") == "xml" ? "xml" : "sql")."/");
- }
- }
- $data->load_modules($this->path("mw_dir")."app/", "data/modules/share/");
- $data->load_modules($this->path("mw_dir")."app/", "data/modules/".($this->bdd("sgbd") == "xml" ? "xml" : "sql")."/");
- $sgbd = new mw_sgbd(
- new $sgbd_impl(
- $this->bdd("host"),
- $this->bdd("base"),
- $this->bdd("user"),
- $this->bdd("password")
- ),
- $this
- );
- if($sgbd->extention_ok()){
- $data->set_sgbd($sgbd);
- $data->set_env($this);
- $this->set_data($data);
- }
- else $this->erreur("L'extention php ".$this->bdd("sgbd")." n'est pas installée", true);
- }
- else $this->erreur("Impossible de lire les plugins pour charger les modules de donnees");
+ if(!class_exists($sgbd_impl)) require_once $sgbd_impl_file;
+ if(!class_exists($sgbd_impl)){
+ $this->erreur("Impossible de trouver la classe d'implementation du sgbd ".$this->bdd("sgbd"), true);
+ }
+ $sgbd = new $sgbd_impl(
+ $this,
+ array(
+ "host" => $this->bdd("host"),
+ "base" => $this->bdd("base"),
+ "user" => $this->bdd("user"),
+ "password" => $this->bdd("password")
+ )
+ );
+ if(!$sgbd->extention_ok()){
+ $this->erreur("L'extention php ".$this->bdd("sgbd")." n'est pas installée", true);