Esempio n. 1
0
 /**
  * Factory for cache implementations.
  *
  * @param array $options Cache options.
  *
  * @throws CacheException
  * @return ICache
  */
 private static function _returnCacheFromImpl($options)
 {
     switch ($options['impl']) {
         case 'file':
             return FileCacheImpl::getInstance($options);
         case 'apc':
             return ApcCacheImpl::getInstance($options);
         case 'dummy':
             return DummyCacheImpl::getInstance($options);
         case 'zend':
             return ZendCacheImpl::getInstance($options['zend']);
         case 'memcached':
             return MemcachedCacheImpl::getInstance($options['memcached']);
         default:
             throw new CacheException('Invalid cache impl requested');
     }
 }