public function execute($filterChain) { // Create a function cache object for the QubitSettings method call $cache = new sfFileCache(array('cache_dir' => sfConfig::get('sf_app_cache_dir') . '/settings')); // Get settings (from cache if exists) if ($cache->has('settings')) { $settings = unserialize($cache->get('settings')); } else { $settings = QubitSetting::getSettingsArray(); $cache->set('settings', serialize($settings)); } // Overwrite/populate settings into sfConfig object sfConfig::add($settings); // Execute next filter $filterChain->execute(); }