X-Git-Url: http://git.dj3c1t.com/?a=blobdiff_plain;f=mw%2Fapp%2Fcontrollers%2Finstall%2Findex.php;h=94e146bd9b9d99e4bd967c753ed9876f7349d416;hb=abc64414fdac6533c011c28b53cba6d28dee4f2a;hp=c47b2318d3304f2eb4a4d98b446c497b29c0ed67;hpb=441212b3fdf07852be95c4a59315aa39a7264249;p=mtweb diff --git a/mw/app/controllers/install/index.php b/mw/app/controllers/install/index.php index c47b231..94e146b 100644 --- a/mw/app/controllers/install/index.php +++ b/mw/app/controllers/install/index.php @@ -163,6 +163,51 @@ $env->erreur("impossible de créer le fichier de configuration"); return; } + require_once $this->config_file; + if( + isset($CONFIG) + && is_array($CONFIG) + ){ + $env->set_config($CONFIG); + } + if( + isset($bdd) + && is_array($bdd) + ){ + foreach($bdd as $bdd_key => $bdd_value){ + if($bdd_key == "table_prefix"){ + if(!($table_prefix = $env->bdd("table_prefix"))){ + $env->erreur("impossible de lire les prefixes de tables"); + return; + } + foreach($table_prefix as $prefix_code => $prefix_value) break; + if(!isset($prefix_code)){ + $env->erreur("impossible de lire le code pour le prefixe de tables"); + return; + } + $table_prefix[$prefix_code] = $bdd_value; + $env->add_table_prefix($table_prefix); + } + else{ + $env->set_bdd($bdd_key, $bdd_value); + } + } + } + if(($plugins = $env->plugins("DESC")) === false){ + $env->erreur("impossible de lister les plugins"); + } + foreach($plugins as $plugin_name => $plugin){ + if(!$plugin["installed"]){ + $env->run("config/plugins/install", array("get" => array("id" => $plugin_name)), false); + if($env->erreurs()) return; + $env->init_plugins("DESC", true); + } + if(!$plugin["enabled"]){ + $env->run("config/plugins/enable", array("get" => array("id" => $plugin_name)), false); + if($env->erreurs()) return; + $env->init_plugins("DESC", true); + } + } $env->redirect( $env->url(), "le site a été installé"