Skip to content

Commit daff16f

Browse files
murrantlaf
authored andcommitted
fix: config_to_json.php does not pull in database configuration settings (librenms#6884)
1 parent 62cde81 commit daff16f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

config_to_json.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
*
88
*/
99

10-
chdir(__DIR__); // cwd to the directory containing this script
10+
$init_modules = array();
11+
require __DIR__ . '/includes/init.php';
1112

12-
// check if we are running through the CLI, otherwise abort
13-
if (php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR'])) {
14-
$config['install_dir'] = __DIR__;
15-
include_once 'includes/defaults.inc.php';
16-
include_once 'config.php';
13+
if (isCli()) {
14+
global $config;
1715
echo json_encode($config);
1816
}

0 commit comments

Comments
 (0)