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
+2 -7
View File
@@ -26,15 +26,10 @@
// get the current LibreNMS install directory
$install_dir = realpath(__DIR__ . '/..');
require_once $install_dir . '/LibreNMS/ClassLoader.php';
// initialize the class loader
$loader = new LibreNMS\ClassLoader();
$loader->registerDir($install_dir . '/tests', 'LibreNMS\Tests');
$loader->register();
require_once $install_dir . '/includes/defaults.inc.php';
$classLoader->registerDir($install_dir . '/tests', 'LibreNMS\Tests');
require_once $install_dir . '/includes/rrdtool.inc.php';
require_once $install_dir . '/includes/syslog.php';