瀏覽代碼

If the config_file doesn't exist then redirect to the install.php

FusionPBX 2 年之前
父節點
當前提交
d388d0e2e0
共有 1 個文件被更改,包括 9 次插入3 次删除
  1. 9 3
      resources/require.php

+ 9 - 3
resources/require.php

@@ -40,15 +40,21 @@
 		}
 	}
 
+//check if the config file exists
+	$config_exists = !empty($config_file) ? true : false;
+
+//config.conf file not found re-direct the request to the install
+	if (!$config_exists) {
+		header("Location: /core/install/install.php");
+		exit;
+	}
+
 //parse the config.conf file
 	$conf = parse_ini_file($config_file);
 
 //set the include path
 	set_include_path($conf['document.root']);
 
-//check if the config file exists
-	$config_exists = !empty($config_file) ? true : false;
-
 //set the server variables and define project path constant
 	$_SERVER["DOCUMENT_ROOT"] = $conf['document.root'];
 	$_SERVER["PROJECT_ROOT"] = $conf['document.root'];