فهرست منبع

add caveat when the config.lua is inside scripts\resources

due to app_defaults running before install_switch create_config_lua
cannot create it's config if the detected folder is scripts\resources\
this solves this by adding a caveat to create it's parent folder when it
is called resources
Matthew Vale 9 سال پیش
والد
کامیت
1e5f9023b0
1فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  1. 8 0
      core/install/resources/classes/install_switch.php

+ 8 - 0
core/install/resources/classes/install_switch.php

@@ -278,6 +278,14 @@ include "root.php";
 
 		public function create_config_lua() {
 			$this->write_progress("\tCreating " . $this->config_lua);
+			$dirs = array_pop(explode("/", normalize_path($config_path)));
+			$path = normalize_path_to_os(join("/", $dirs));
+			if($dirs[(sizeof($dirs)-1)] == 'resources' and !file_exists($path)){
+				if (!mkdir($path, 0755, true)) {
+					throw new Exception("Failed to create the missing resources directory '$path'");
+				}
+			}
+			
 			global $db;
 		//get the odbc information
 			$sql = "select count(*) as num_rows from v_databases ";