public static function initialize() { // only run once if (static::$_initialized) { return false; } // load config from Site static::$SiteID = 1; //Site::$ID; static::$SiteName = Site::$Title; // parse path $path = $_SERVER['REQUEST_URI']; if ($qPos = strpos($_SERVER['REQUEST_URI'], '?')) { $path = substr($path, 0, $qPos); } static::setPath($path); // set locale setlocale(LC_ALL, self::$Locale); // load core features foreach (self::$CoreFeatures as $featureName) { require self::$CodePath . '/Core/' . $featureName . '.inc.php'; self::$_loadedFeatures[] = $featureName; } // register class autoloader //spl_autoload_register('MICS::loadClass'); // register exception handler //set_exception_handler('MICS::handleException'); //set_error_handler('MICS::handleError', E_WARNING); // update include path set_include_path(get_include_path() . PATH_SEPARATOR . self::$CodePath); // set headers header('Pragma: no-cache'); header('Cache-Control: max-age=0, no-cache, no-store, must-revalidate'); // call micsInitialized for core features foreach (self::$_loadedFeatures as $featureName) { if (method_exists($featureName, 'micsInitialized')) { call_user_func(array($featureName, 'micsInitialized')); } } // record state change self::$_initialized = true; }