Ejemplo n.º 1
0
 /**
  * get the global cache
  * @return OC_Cache
  */
 public static function getGlobalCache($fast = false)
 {
     if (!self::$global_cache) {
         self::$global_cache_fast = null;
         if (!self::$global_cache_fast && function_exists('xcache_set')) {
             self::$global_cache_fast = new OC_Cache_XCache(true);
         }
         if (!self::$global_cache_fast && function_exists('apc_store')) {
             self::$global_cache_fast = new OC_Cache_APC(true);
         }
         self::$global_cache = new OC_Cache_FileGlobal();
         if (self::$global_cache_fast) {
             self::$global_cache = new OC_Cache_Broker(self::$global_cache_fast, self::$global_cache);
         }
     }
     if ($fast) {
         if (self::$global_cache_fast) {
             return self::$global_cache_fast;
         } else {
             return false;
         }
     }
     return self::$global_cache;
 }