/** * loadExtensions * * load in modules by calling scripts, will load both core chart modules and plugins * * @param string $dir path to directory */ public static function loadExtensions($mode, &$settings, &$classes, &$modules, $logger = false) { //loads modules code if ($logger) { $class = 'log.'; } else { $class = 'class.'; } $previous = null; if (DEBUG) { echo "<pre>Loading " . $mode . "<br>"; } //if module is true in settings.ini file then we load it in foreach ($settings->general[$mode] as $key => &$value) { if ($value == "true") { try { $loadModule = $key . DIRECTORY_SEPARATOR . $class . $key . '.php'; //if (LOGDEBUG) echo 'Loading module ' . $loadModule . "\n"; //this doesnt work as its defined as in the path... set in globals //maybe we should change this to not be relative ? //if ( file_exists ( $loadModule )) //{ if (LoadUtility::fileExists($loadModule)) { //echo "Module File Exists \n"; require_once $loadModule; $classes[$key] = new $key(); $modules[$key] = $settings->general[$mode][$key]; } else { //echo "Module File Doesnt Exists \n"; } //$settings->general[$mode]["Cpu"] } catch (Exception $e) { throw Exception($e->getMessage()); } $previous = $key; } } if (DEBUG) { echo "</pre>"; } }