3 function __mw($config_file, $etat = ""){
5 $PATHES["app"] .= $PATHES["app"] && substr($PATHES["app"], -1) != "/" ? "/" : "";
6 $PATHES["libs"] .= $PATHES["libs"] && substr($PATHES["libs"], -1) != "/" ? "/" : "";
7 if($sxml_class_file = (file_exists($PATHES["libs"]."sxml.php") ? $PATHES["libs"]."sxml.php" : "")){
8 if($empty_class_file = (file_exists($PATHES["libs"]."empty_class.php") ? $PATHES["libs"]."empty_class.php" : "")){
9 if($env_class_file = (file_exists($PATHES["app"]."env/mw_env.php") ? $PATHES["app"]."env/mw_env.php" : "")){
10 require $sxml_class_file;
11 require $empty_class_file;
12 require $env_class_file;
13 $env = new mw_env(true);
14 $env->load_modules($PATHES["app"], "env/modules/");
15 $env->set_config_file($config_file);
16 $env->set_PATHES($PATHES);
18 $env->load_config($bdd, $CONFIG);
20 $etat = ($etat === false ? false : ($etat ? $etat : (isset($_GET[$env->param("e")]) ? $_GET[$env->param("e")] : "")));
21 if($etat !== false) $env->run($etat);
24 else echo "<pre>impossible de trouver le fichier <strong>env/mw_env.php</strong></pre>";
26 else echo "<pre>impossible de trouver le fichier <strong>".$libs_path."empty_class.php</strong></pre>";
28 else echo "<pre>impossible de trouver le fichier <strong>".$libs_path."sxml.php</strong></pre>";
32 function __mw_display($env){
33 if($env->etat_is_valid()) $env->render_layout($env->init_layout());