From 3943fccc828cda562dcc850e2dcfbf33a5a67f6f Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Sat, 24 Jun 2017 01:24:15 -0500 Subject: [PATCH] fix: config_to_json.php does not pull in database configuration settings --- 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 6d8ecc5e11df..b4e5067222cd 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); }