/** * Loads the default data for the application (config, DB, options, etc). */ public function loadDefaultData() { $config = $this->loadConfig(); self::set('config', $config); self::setDebugMode($config->debug); self::$jsVersion = substr(md5(self::$versionId . $config->jsVersion), 0, 8); self::$externalDataPath = (string) $config->externalDataPath; $this->addLazyLoader('db', array($this, 'loadDb'), $config->db); $this->addLazyLoader('cache', array($this, 'loadCache'), $config->cache); $this->addLazyLoader('options', array($this, 'loadOptions')); $this->addLazyLoader('simpleCache', array($this, 'loadSimpleCache')); }
/** * Setup necessary system defaults based on the options. * * @param XenForo_Options $options */ public static function setDefaultsFromOptions(XenForo_Options $options) { if ($options->useFriendlyUrls) { XenForo_Link::useFriendlyUrls(true); } if ($options->romanizeUrls) { XenForo_Link::romanizeTitles(true); } if ($options->indexRoute && preg_match('/^[a-z0-9-]/i', $options->indexRoute)) { XenForo_Link::setIndexRoute($options->indexRoute); } XenForo_Link::includeTitlesInUrls($options->includeTitleInUrls); self::$jsVersion = substr(md5(self::$jsVersion . $options->jsLastUpdate), 0, 8); }