$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é"
# init
#
- function init_plugins($PRIORITE = "ASC"){
- if(isset($this->plugins_asc) || isset($this->plugins_desc)){
+ function init_plugins($PRIORITE = "ASC", $RELOAD = false){
+ if(!$RELOAD && (isset($this->plugins_asc) || isset($this->plugins_desc))){
if($PRIORITE == "ASC"){
if(!isset($this->plugins_asc)) $this->plugins_asc = $this->ordonne_plugins($this->plugins_desc, $PRIORITE);
}