コード例 #1
0
ファイル: Web.php プロジェクト: xiaoguizhidao/koala-framework
 public static function reload()
 {
     $configClass = Kwf_Setup::$configClass;
     $config = new $configClass(Kwf_Setup::getConfigSection());
     $cacheId = 'config_' . str_replace('-', '_', Kwf_Setup::getConfigSection());
     Kwf_Config_Cache::getInstance()->save($config, $cacheId);
     if (extension_loaded('apc')) {
         $apcCacheId = $cacheId . getcwd();
         apc_delete($apcCacheId);
         apc_delete($apcCacheId . 'mtime');
     }
     Kwf_Config_Web::clearInstances();
     Kwf_Registry::set('config', $config);
 }
コード例 #2
0
 public static function reload()
 {
     $configClass = Kwf_Setup::$configClass;
     $config = new $configClass(Kwf_Setup::getConfigSection());
     $cacheId = 'config_' . str_replace(array('-', '.'), '_', Kwf_Setup::getConfigSection());
     Kwf_Config_Cache::getInstance()->save($config, $cacheId);
     if (extension_loaded('apc')) {
         $apcCacheId = $cacheId . getcwd();
         apc_delete($apcCacheId);
         apc_delete($apcCacheId . 'mtime');
         if (PHP_SAPI == 'cli') {
             Kwf_Util_Apc::callClearCacheByCli(array(array('cacheIds' => $apcCacheId . ',' . $apcCacheId . 'mtime')));
         }
         Kwf_Cache_SimpleStatic::clear('config-');
     }
     Kwf_Config_Web::clearInstances();
     Kwf_Registry::set('config', $config);
 }