本文整理汇总了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];
}