return $this->get_error();
}
$env = $this->env();
- if($env->data_upgrade_required()){
+ if(($res = $env->data_upgrade_required()) === true){
$this->upgrade();
exit;
}
+ else{
+ if($res !== false){
+ $this->error($res);
+ return $this->get_error();
+ }
+ }
return true;
}
function init_pathes(){
- if(($n = strpos($_SERVER["REQUEST_URI"], "?")) !== false){
- $_SERVER["REQUEST_URI"] = substr($_SERVER["REQUEST_URI"], 0, $n);
+ $REQUEST_URI = $_SERVER["REQUEST_URI"];
+ if(($n = strpos($REQUEST_URI, "?")) !== false){
+ $REQUEST_URI = substr($REQUEST_URI, 0, $n);
}
- $web_path = explode("/", preg_replace('#/+#','/',$_SERVER["REQUEST_URI"]));
+ $web_path = explode("/", preg_replace('#/+#','/',$REQUEST_URI));
$this->pathes["web"] = "";
for($i = 0; $i < count($web_path) - 1; $i++) $this->pathes["web"] .= $web_path[$i]."/";
if(
$env->load_versions();
$env->load_config($this->bdd, $this->config);
$env->init();
- $env->init_data_upgrades();
+ if(($res = $env->init_data_upgrades()) !== true){
+ $this->error("impossible de lire les upgrades. ".$res);
+ return false;
+ }
return true;
}