/** * clear the cache * @param array $appFilter */ public function clearCache($appFilter = null) { if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) { Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Clearing config cache'); } if (Tinebase_Core::get(Tinebase_Core::SHAREDCACHE)) { if (isset($appFilter)) { list($key, $value) = each($appFilter); $appName = $key === 'name' ? $value : Tinebase_Application::getInstance()->getApplicationById($value)->name; } else { $appName = $this->_appName; } Tinebase_Core::getCache()->remove('cachedAppConfig_' . $appName); } Tinebase_Cache_PerRequest::getInstance()->reset('Tinebase_Config_Abstract'); $cachedConfigFile = Tinebase_Core::guessTempDir() . DIRECTORY_SEPARATOR . 'cachedConfig.inc.php'; if (file_exists($cachedConfigFile)) { unlink($cachedConfigFile); } // reset class caches last because they would be filled again by Tinebase_Core::guessTempDir() self::$_configFileData = null; $this->_cachedApplicationConfig = null; }
/** * returns data from central config.inc.php file * * @return array */ protected function _getConfigFileData() { if (!self::$_configFileData) { $configData = (include 'config.inc.php'); if ($configData === false) { die('central configuration file config.inc.php not found in includepath: ' . get_include_path()); } self::$_configFileData = $configData; } return self::$_configFileData; }
/** * returns data from central config.inc.php file * * @return array */ protected function _getConfigFileData() { if (!self::$_configFileData) { self::$_configFileData = (include 'config.inc.php'); if (self::$_configFileData === false) { die('central configuration file config.inc.php not found in includepath: ' . get_include_path()); } if (isset(self::$_configFileData['confdfolder'])) { $tmpDir = Tinebase_Core::guessTempDir(self::$_configFileData); $cachedConfigFile = $tmpDir . DIRECTORY_SEPARATOR . 'cachedConfig.inc.php'; if (file_exists($cachedConfigFile)) { $cachedConfigData = (include $cachedConfigFile); } else { $cachedConfigData = false; } if (false === $cachedConfigData || $cachedConfigData['ttlstamp'] < time()) { $this->_createCachedConfig($tmpDir); } else { self::$_configFileData = $cachedConfigData; } } } return self::$_configFileData; }