/** * Initialize the context * * @return null */ public static function initialize() { try { self::$_request = new TBGRequest(); self::$_response = new TBGResponse(); self::$_factory = new TBGFactory(); self::checkInstallMode(); self::loadPreModuleRoutes(); self::setScope(); if (!self::$_installmode) { self::loadModules(); self::initializeUser(); TBGSettings::setTimezone(); } else { self::$_modules = array(); } // var_dump(self::getUser());die(); self::setupI18n(); self::loadPostModuleRoutes(); TBGLogging::log('...done initializing'); } catch (Exception $e) { if (!self::isCLI() && !self::isInstallmode()) { throw $e; } } }
/** * Returns the factory object * * @return TBGFactory */ public static function factory() { if (!self::$_factory instanceof TBGFactory) { self::$_factory = new TBGFactory(); } return self::$_factory; }