mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: Centralize includes and initialization (#4991)
This commit is contained in:
committed by
Neil Lathwood
parent
bbf05feb90
commit
9a33464c52
11
validate.php
11
validate.php
@@ -15,7 +15,6 @@
|
||||
|
||||
chdir(__DIR__); // cwd to the directory containing this script
|
||||
|
||||
require_once 'includes/defaults.inc.php';
|
||||
require_once 'includes/common.php';
|
||||
|
||||
$options = getopt('m:h::');
|
||||
@@ -38,7 +37,6 @@ if (isset($options['h'])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$console_color = new Console_Color2();
|
||||
|
||||
// critical config.php checks
|
||||
if (!file_exists('config.php')) {
|
||||
@@ -68,8 +66,8 @@ if ($config_failed) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// load config.php now
|
||||
require_once 'config.php';
|
||||
$init_modules = array();
|
||||
require 'includes/init.php';
|
||||
|
||||
// make sure install_dir is set correctly, or the next includes will fail
|
||||
if (!file_exists($config['install_dir'].'/config.php')) {
|
||||
@@ -77,11 +75,6 @@ if (!file_exists($config['install_dir'].'/config.php')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// continue loading includes
|
||||
require_once 'includes/definitions.inc.php';
|
||||
require_once 'includes/functions.php';
|
||||
require_once 'includes/alerts.inc.php';
|
||||
|
||||
$versions = version_info();
|
||||
$cur_sha = $versions['local_sha'];
|
||||
|
||||
|
Reference in New Issue
Block a user