X-Git-Url: http://git.dj3c1t.com/?a=blobdiff_plain;f=mw%2Fapp%2Fcontrollers%2Finstall%2Findex.php;h=07fb56ee503ccc9e3f37cedd3367391776c9cfd7;hb=61f37fc21cac669aa439d0681590f5ceccad3157;hp=8cc63f085cbdb37cd3cc01c5612801ba0ee416b3;hpb=a4819cb78b71363db14f8c568a9a2552ee8f58da;p=mtweb diff --git a/mw/app/controllers/install/index.php b/mw/app/controllers/install/index.php index 8cc63f0..07fb56e 100644 --- a/mw/app/controllers/install/index.php +++ b/mw/app/controllers/install/index.php @@ -159,6 +159,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é"