From 461a30d771edd8bc6606f2c92dfde363514b93b1 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 14 Jun 2013 12:09:08 +0200 Subject: Merge config files (#1487311). Now we have defaults.inc.php and config.inc.php. Renamed $rcmail_config to $config. Old naming and old files are supported for backward compatibility. --- installer/test.php | 112 ++++++++++++++++++++++------------------------------- 1 file changed, 47 insertions(+), 65 deletions(-) (limited to 'installer/test.php') diff --git a/installer/test.php b/installer/test.php index fb3e7e937..c2e321455 100644 --- a/installer/test.php +++ b/installer/test.php @@ -7,52 +7,44 @@ if (!class_exists('rcube_install') || !is_object($RCI)) { ?>
-

Check config files

+

Check config file

config)) { - $RCI->pass('main.inc.php'); -} -else if ($read_main) { - $RCI->fail('main.inc.php', 'Syntax error'); +if ($read_config = is_readable(RCUBE_CONFIG_DIR . 'defaults.inc.php')) { + $config = $RCI->load_config_file(RCUBE_CONFIG_DIR . 'defaults.inc.php'); + if (!empty($config)) { + $RCI->pass('defaults.inc.php'); + } + else { + $RCI->fail('defaults.inc.php', 'Syntax error'); + } } -else if (!$read_main) { - $RCI->fail('main.inc.php', 'Unable to read file. Did you create the config files?'); +else { + $RCI->fail('defaults.inc.php', 'Unable to read default config file?'); } echo '
'; -if ($read_db && !empty($RCI->config['db_dsnw'])) { - $RCI->pass('db.inc.php'); -} -else if ($read_db) { - $RCI->fail('db.inc.php', 'Syntax error'); +if ($read_config = is_readable(RCUBE_CONFIG_DIR . 'config.inc.php')) { + $config = $RCI->load_config_file(RCUBE_CONFIG_DIR . 'config.inc.php'); + if (!empty($config)) { + $RCI->pass('config.inc.php'); + } + else { + $RCI->fail('config.inc.php', 'Syntax error'); + } } -else if (!$read_db) { - $RCI->fail('db.inc.php', 'Unable to read file. Did you create the config files?'); +else { + $RCI->fail('config.inc.php', 'Unable to read file. Did you create the config file?'); } +echo '
'; -if ($RCI->configured && ($messages = $RCI->check_config())) { - - if (is_array($messages['missing'])) { - echo '

Missing config options

'; - echo '

The following config options are not set (not present or empty) in the current configuration.
'; - echo 'Please check the default config files and set the missing properties in your local config files.

'; - - echo ''; - } +if ($RCI->configured && ($messages = $RCI->check_config())) { if (is_array($messages['replaced'])) { echo '

Replaced config options

'; echo '

The following config options have been replaced or renamed. '; echo 'Please update them accordingly in your config files.

'; - + echo '