From daff16fabbe780d924958e98d6932f48ae67bee5 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Sat, 24 Jun 2017 15:21:30 -0500 Subject: [PATCH] fix: config_to_json.php does not pull in database configuration settings (#6884) --- config_to_json.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/config_to_json.php b/config_to_json.php index 6d8ecc5e11..b4e5067222 100755 --- a/config_to_json.php +++ b/config_to_json.php @@ -7,12 +7,10 @@ * */ -chdir(__DIR__); // cwd to the directory containing this script +$init_modules = array(); +require __DIR__ . '/includes/init.php'; -// check if we are running through the CLI, otherwise abort -if (php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR'])) { - $config['install_dir'] = __DIR__; - include_once 'includes/defaults.inc.php'; - include_once 'config.php'; +if (isCli()) { + global $config; echo json_encode($config); }