From 5b67c8d6f94bcc339d96c2d9ac2cdd833eab334c Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Fri, 11 Jun 2021 11:08:32 +0200 Subject: [PATCH] Fix issue 12 Remove empty defaults from database definitions - Doctrine parses incorrectly Add case in installer to create extconfig.conf if does not exist --- install.php | 17 ++++++++++++++--- module.xml | 12 ++++++------ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/install.php b/install.php index 3e4a033..4bbc094 100644 --- a/install.php +++ b/install.php @@ -793,18 +793,23 @@ function Setup_RealTime() // Check extconfig file for correct connector values $ext_conf = ''; - $ext_conf_file = 'extconfig.conf'; + $ext_conf_file = ''; $backup_ext = array('_custom.conf', '_additional.conf','.conf'); foreach ($backup_ext as $value) { if (file_exists($dir . '/extconfig' . $value)) { // Last possibility is normal file extconfig.conf - $ext_conf_file = 'extconfig' . $value; + $ext_conf_file = $dir . 'extconfig' . $value; $ext_conf = $cnf_read->getConfig($ext_conf_file); break; } } + if (empty($ext_conf_file)) { + // Have not found a file, so will need to create. $ext_conf must be empty + $ext_conf_file = $dir . '/extconfig.conf'; + } if (!empty($ext_conf)) { + // Have found a file and read a config. Now need to check required settings $currentExtSettings = array(); $writeExtSettings = $ext_conf; if (empty($ext_conf['settings']['sccpdevice']) || ($ext_conf['settings']['sccpdevice'] !== $def_ext_config['sccpdevice'])) { @@ -816,9 +821,15 @@ function Setup_RealTime() $writeExtSettings['settings']['sccpline'] = $def_ext_config['sccpline']; } if (!empty($writeExtSettings)) { - outn("