3 if(!class_exists("mw_sgbd")) require_once $this->app_file("data/mw_sgbd.php");
4 if(!class_exists("mw_data")) require_once $this->app_file("data/mw_data.php");
5 if(($plugins = $this->plugins("DESC")) === false){
6 $this->erreur("Impossible de lire les plugins pour charger les modules de donnees", true);
8 $data = new mw_data(true);
9 if($this->bdd("sgbd")){
10 if(!$this->app_file_exists("data/impl/mw_".$this->bdd("sgbd").".php")){
11 $this->erreur("Impossible de trouver le fichier d'implementation du sgbd ".$this->bdd("sgbd"), true);
13 $sgbd_impl = "mw_".$this->bdd("sgbd");
14 if(!class_exists($sgbd_impl)) require_once $this->app_file("data/impl/".$sgbd_impl.".php");
15 if(!class_exists($sgbd_impl)){
16 $this->erreur("Impossible de trouver la classe d'implementation du sgbd ".$this->bdd("sgbd"), true);
21 "host" => $this->bdd("host"),
22 "base" => $this->bdd("base"),
23 "user" => $this->bdd("user"),
24 "password" => $this->bdd("password")
29 if(!$sgbd->extention_ok()){
30 $this->erreur("L'extention php ".$this->bdd("sgbd")." n'est pas installée", true);
33 foreach($plugins as $plugin_name => $plugin){
34 if($plugin["installed"] && $plugin["enabled"]){
35 $data->load_modules($this->path("mw_dir")."plugins/".$plugin_name."/app/", "data/modules/share/");
36 if($this->bdd("sgbd")){
37 $data->load_modules($this->path("mw_dir")."plugins/".$plugin_name."/app/", "data/modules/".($this->bdd("sgbd") == "xml" ? "xml" : "sql")."/");
41 $data->load_modules($this->path("mw_dir")."app/", "data/modules/share/");
42 if($this->bdd("sgbd")){
43 $data->load_modules($this->path("mw_dir")."app/", "data/modules/".($this->bdd("sgbd") == "xml" ? "xml" : "sql")."/");
44 $data->set_sgbd($sgbd);
46 $data->set_env($this);
47 $this->set_data($data);