From f3f24c40858f1c931ebe44caacbd4154fcdc266d Mon Sep 17 00:00:00 2001 From: Matthew Vale Date: Thu, 3 Dec 2015 10:40:54 +0000 Subject: [PATCH] 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 --- core/install/resources/classes/install_switch.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/install/resources/classes/install_switch.php b/core/install/resources/classes/install_switch.php index 3e34071dae..2df6ac189f 100644 --- a/core/install/resources/classes/install_switch.php +++ b/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 ";