Set the default metadata cache

@param string|Zend_Cache_Core $cache
@return void
11513
protected function setDefaultMetadataCache($cache, ServiceLocatorInterface $serviceLocator)
    {
        $metadataCache = null;

        if (is_string($cache)) {
            if ($serviceLocator->has($cache)) {
                $metadataCache = $serviceLocator->get($cache);
            }
        } else if ($cache instanceof Zend_Cache_Core) {
            $metadataCache = $cache;
        }

        if ($metadataCache instanceof Zend_Cache_Core) {
            Zend_Db_Table::setDefaultMetadataCache($metadataCache);
        }

    }
1033911
function getMetadataCache() {
		if (!isset($this->metadatCache)) {
			$this->metadataCache = static::$defaultMetadataCache ?: new Table\StaticCache;
		}
		return $this->metadataCache;
	}
651208
public void
setCache(Cache cache) {
	if (cache == null) {
		this.cache = new Cache(dclass);
		this.temporary_cache = true;
	} else {
		this.cache = cache;
		this.temporary_cache = false;
	}
}
556546
protected function _initCache()
    {
        if (!Cache::getConfig(static::$cacheConfig)) {
            Cache::setConfig(static::$cacheConfig, [
                'className' => $this->_getDefaultCacheConfigClassName(),
                'prefix' => static::$cacheConfig . '_' . $this->_identifier,
                'duration' => $this->getConfig('interval'),
            ]);
        }
    }
1362165
public function setCache() {
        if (!file_exists($this->_fileName)) {
            file_put_contents($this->_fileName, $this->_compress(serialize($this->_content)));
        }

        $timeAgo = time() - filemtime($this->_fileName);

        if ($timeAgo > $this->_time) {
            file_put_contents($this->_fileName, $this->_compress(serialize($this->_content)));
        }
    }
334433
public function addCache(AbstractCacheAdapterInterface $cache)
  {
    $this->caches[\strtolower($cache->getDriver())] = $cache;

    return $this;
  }
1331082
public function setDefaultsFromConfiguration()
    {
        $this->ignoreCache = isset($this->config["ignoreCache"])
            ? $this->config["ignoreCache"]
            : $this->ignoreCache;

        return $this;
    }
218418
protected function createAllCaches(): void
    {
        foreach (array_keys($this->cacheConfigurations) as $identifier) {
            if ($identifier !== 'Default' && !isset($this->caches[$identifier])) {
                $this->createCache($identifier);
            }
        }
    }
923599
public function setCache(?CacheInterface $cache)
    {
        if (!$cache) {
            $cache = new VoidCachePool();
        }
        $this->cache = $cache;

        return $this;
    }
778900
public function clear($cache = null)
    {
        if (null !== $cache) {
            if (!array_key_exists($cache, $this->caches)) {
                throw new CacheNotFoundException($cache);
            }

            $this->caches[$cache]->clear();
        } else {
            foreach ($this->caches as $cache) {
                $cache->clear();
            }
        }
    }
1065574
public function updateCachedMetadata()
    {
        $ed = $this->getEntitiesDescriptor();
        $ed = $this->exclude($ed);
        $ed = $this->filter($ed);
        $this->addSignature($ed);

        $xml = $ed->toXML();
        $xml = $xml->ownerDocument->saveXML($xml);

        if ($this->cacheGenerated !== null) {
            Logger::debug($this->logLoc.'Saving generated metadata to cache.');
            $this->addCacheItem($this->cacheId, $xml, time() + $this->cacheGenerated, $this->cacheTag);
        }

        return $xml;
    }
1228841
protected function setupMetaData()
    {
        MetaDataManager::registerDrivers(
            $this->config['meta']['drivers'],
            $this->config['dev']
        );

        MetaDataManager::resolved(function (Configuration $configuration) {

            // Debugbar
            if ($this->config['debugbar'] === true) {
                $debugStack = new DebugStack();
                $configuration->setSQLLogger($debugStack);
                $this->app['debugbar']->addCollector(
                    new DoctrineCollector($debugStack)
                );
            }

            $configuration->getMetadataDriverImpl()->addPaths([
                __DIR__ . '/Migrations',
                __DIR__ . '/Auth/Passwords'
            ]);

            // Automatically make table, column names, etc. like Laravel
            $configuration->setNamingStrategy(
                $this->app->make(LaravelNamingStrategy::class)
            );

            // Custom functions
            $configuration->setCustomDatetimeFunctions($this->config['custom_datetime_functions']);
            $configuration->setCustomNumericFunctions($this->config['custom_numeric_functions']);
            $configuration->setCustomStringFunctions($this->config['custom_string_functions']);

            // Second level caching
            if ($this->config['cache']['second_level']) {
                $configuration->setSecondLevelCacheEnabled(true);

                $cacheConfig = $configuration->getSecondLevelCacheConfiguration();
                $cacheConfig->setCacheFactory(
                    new DefaultCacheFactory(
                        $cacheConfig->getRegionsConfiguration(),
                        CacheManager::resolve(
                            $this->config['cache']['default']
                        )
                    )
                );
            }
        });
    }
516162
public static function setCacheDriver(Cache $cache = null, $namespace = null)
    {
        self::setCache(self::$cacheDriver, $cache, $namespace);
    }
1363189
function setCache($cache,$expire=3600)
	{
		$this->cache = $cache;
		$this->if_cache = true;
		$this->expire = $expire;
	}
7048
protected function _setDefaultOptions($options)
    {
        if (!is_array($options)) {
            Zend_Cache::throwException('default_options must be an array !');
        }
        foreach ($options as $key=>$value) {
            if (!is_string($key)) {
                Zend_Cache::throwException("invalid option [$key] !");
            }
            $key = strtolower($key);
            if (isset($this->_specificOptions['default_options'][$key])) {
                $this->_specificOptions['default_options'][$key] = $value;
            }
        }
    }
1331034
public function forgetMetaData($key): void
    {
        $meta = $this->getAttribute('meta');

        if (\is_array($key)) {
            foreach ($key as $name) {
                $meta->forget($name);
            }
        } else {
            $meta->forget($key);
        }

        $this->setMetaAttribute($meta);
    }
1150082
public function setCache($cache)
    {
        $this->cache = $cache;
        if ($this->isBool($cache) && $cache === false) {
            $this->cache = $cache;
        } else {
            if (is_object($cache)) {
                if ($this->isInstanceOf($cache, CacheStorage::class)) {
                    $this->cache = $cache;
                } else {
                    throw new RouterException('$cache must either be a boolean or instance of ' . CacheStorage::class . '.');
                }
            } else {
                $this->cache = $this->cache($cache);
            }
        }
    }