Centralize class loader (#4169)

Move the classloader to as early as possible in defaults.inc.php
This should cover all application entrances.
Set install_dir based on the location of defaults.inc.php
This commit is contained in:
Tony Murray
2016-08-22 17:59:59 -05:00
committed by Neil Lathwood
parent e920e28e48
commit 7b93b564da
6 changed files with 15 additions and 41 deletions

View File

@@ -17,13 +17,6 @@ require_once '../includes/defaults.inc.php';
require_once '../config.php';
require_once '../includes/definitions.inc.php';
// initialize the class loader and add custom mappings
require_once $config['install_dir'] . '/LibreNMS/ClassLoader.php';
$classLoader = new LibreNMS\ClassLoader();
$classLoader->registerClass('Console_Color2', $config['install_dir'] . '/includes/console_colour.php');
$classLoader->registerClass('PasswordHash', $config['install_dir'] . '/html/lib/PasswordHash.php');
$classLoader->register();
require_once '../includes/common.php';
require_once '../includes/dbFacile.php';
require_once '../includes/rewrites.php';