register(); } require_once($icingaLibPath . '/Test/ClassLoader.php'); $loader = new Icinga\Test\ClassLoader(); $loader->registerNamespace('Tests', $testLibraryPath); $loader->registerNamespace('Icinga', $icingaLibPath); $loader->registerNamespace('Icinga\\Forms', $applicationPath . '/forms'); $modulePaths = getenv('ICINGAWEB_MODULE_DIRS'); if ($modulePaths) { $modulePaths = preg_split('/:/', $modulePaths, -1, PREG_SPLIT_NO_EMPTY); } if (! $modulePaths) { $modulePaths = array_flip(scandir($modulePath)); unset($modulePaths['.']); unset($modulePaths['..']); $modulePaths = array_keys($modulePaths); foreach ($modulePaths as &$path) { $path = "$modulePath/$path"; } unset($path); } foreach ($modulePaths as $path) { $module = basename($path); $moduleNamespace = 'Icinga\\Module\\' . ucfirst($module); $moduleLibraryPath = "$path/library/" . ucfirst($module); if (is_dir($moduleLibraryPath)) { $loader->registerNamespace($moduleNamespace, $moduleLibraryPath); } $moduleTestPath = "$path/test/php"; if (is_dir($moduleTestPath)) { $loader->registerNamespace('Tests\\' . $moduleNamespace, $moduleTestPath); } $moduleFormPath = "$path/application/forms"; if (is_dir($moduleFormPath)) { $loader->registerNamespace($moduleNamespace . '\\Forms', $moduleFormPath); } } $loader->register(); set_include_path( implode( PATH_SEPARATOR, array($libraryPath . '/vendor', get_include_path()) ) ); require_once 'Zend/Loader/Autoloader.php'; \Zend_Loader_Autoloader::getInstance(); Icinga\Application\Config::$configDir = $configPath;