当前位置: 首页>>代码示例>>PHP>>正文


PHP vB_Cache::disableCache方法代码示例

本文整理汇总了PHP中vB_Cache::disableCache方法的典型用法代码示例。如果您正苦于以下问题:PHP vB_Cache::disableCache方法的具体用法?PHP vB_Cache::disableCache怎么用?PHP vB_Cache::disableCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vB_Cache的用法示例。


在下文中一共展示了vB_Cache::disableCache方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: instance

 /**
  * Returns an instance of the global cache.
  * The cache type used is defined in options.
  *
  * @return vB_Cache							- Reference to instance of the cache handler
  */
 public static function instance($type = self::CACHE_STD)
 {
     $DEFAULTS_CACHETYPE = self::getDefaults();
     $vb5_config =& vB::getConfig();
     if (!empty($vb5_config['Misc']['debug']) and !empty($_REQUEST['nocache'])) {
         self::$disableCache = 1;
     }
     if (!isset(self::$instance[$type])) {
         if (!isset($vb5_config['Cache']) or !isset($vb5_config['Cache']['class']) or !is_array($vb5_config['Cache']['class']) or !isset($vb5_config['Cache']['class'][$type])) {
             $cacheClass = $DEFAULTS_CACHETYPE[$type];
         } else {
             $cacheClass = $vb5_config['Cache']['class'][$type];
         }
         // if more than 1 of the 3 types (STD, FAST, LARGE) are using the same implementation,
         // don't create a new instance, just share the same one.
         foreach (array(self::CACHE_STD, self::CACHE_FAST, self::CACHE_LARGE) as $cacheType) {
             if (!empty(self::$instance[$cacheType]) and is_a(self::$instance[$cacheType], $cacheClass)) {
                 self::$instance[$type] = self::$instance[$cacheType];
                 return self::$instance[$type];
             }
         }
         // call constructor directly.  Having static functions with the same name but different
         // semantics in the subclasses works, but its tacky.
         self::$instance[$type] = new $cacheClass($type);
         //call_user_func(array($cacheClass, 'instance'));
         vB_Shutdown::instance()->add(array(self::$instance[$type], 'shutdown'));
     }
     return self::$instance[$type];
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:35,代码来源:cache.php


注:本文中的vB_Cache::disableCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。