Retrieve hydrator cache driver.

@throws \InvalidArgumentException

@return CacheProvider
774661
public function getHydratorCacheDriver()
    {
        if (!$this->hydratorCacheDriver instanceof CacheProvider) {
            $this->hydratorCacheDriver = $this->getCacheDriver(
                (string) $this->getOption('hydrator_cache_namespace'),
                $this->getOption('hydrator_cache_driver')
            );
        }

        return $this->hydratorCacheDriver;
    }
653852
protected function getCacheManager()
    {
        if (null === $this->cacheManager) {
            $this->cacheManager = $this->get('sulu_media.format_manager');
        }

        return $this->cacheManager;
    }
324809
public function getMemcached()
    {
        if ($this->_cache === null) {
            if (!extension_loaded('memcached')) {
                throw new InvalidConfigException('MemCached requires PHP memcached extension to be loaded.');
            }

            $this->_cache = $this->persistentId !== null ? new \Memcached($this->persistentId) : new \Memcached;
            if ($this->username !== null || $this->password !== null) {
                $this->_cache->setOption(\Memcached::OPT_BINARY_PROTOCOL, true);
                $this->_cache->setSaslAuthData($this->username, $this->password);
            }
            if (!empty($this->options)) {
                $this->_cache->setOptions($this->options);
            }
        }

        return $this->_cache;
    }
960113
private function getProvider($path)
    {
        $cacheProvider = $this->getCacheProviderConfig($path);

        if (!$cacheProvider) {
            return null;
        }

        if (is_string($cacheProvider['cache']) &&
            $this->serviceLocator->has($cacheProvider['cache'])
        ) {
            return $this->serviceLocator->get($cacheProvider['cache']);
        }

        // Left here for BC.  Please consider defining a ZF2 service instead.
        if (is_callable($cacheProvider['cache'])) {
            return call_user_func($cacheProvider['cache'], $path);
        }

        $dir = '';
        $class = $cacheProvider['cache'];

        if (!empty($cacheProvider['options']['dir'])) {
            $dir = $cacheProvider['options']['dir'];
        }

        $class = $this->classMapper($class);
        return new $class($dir, $path);
    }
1269214
public function getCache() {
    if (!isset($this->cache))
      $this->cache = new \Doctrine\Common\Cache\ArrayCache;
      
    return $this->cache;
  }
659191
public function getCache()
    {
        if ($this->cache) {
            return $this->cache;
        }

        if (property_exists($this, 'app') && $this->app instanceof ServiceContainer
            && isset($this->app['cache']) && $this->app['cache'] instanceof CacheInterface) {
            return $this->cache = $this->app['cache'];
        }

        return $this->cache = $this->createDefaultCache();
    }
405177
protected function getConnectionFromDriverManager()
    {
        $configuration = new Configuration();
        $connectionParameters = $this->getConnectionParameters();

        return DriverManager::getConnection($connectionParameters, $configuration);
    }
532703
public function getHydratorClass() : string
    {
        $inflector         = $this->configuration->getClassNameInflector();
        $realClassName     = $inflector->getUserClassName($this->configuration->getHydratedClassName());
        $hydratorClassName = $inflector->getGeneratedClassName($realClassName, ['factory' => static::class]);

        if (! class_exists($hydratorClassName) && $this->configuration->doesAutoGenerateProxies()) {
            $generator     = $this->configuration->getHydratorGenerator();
            $originalClass = new ReflectionClass($realClassName);
            $generatedAst  = $generator->generate($originalClass);
            $traverser     = new NodeTraverser();

            $traverser->addVisitor(new ClassRenamerVisitor($originalClass, $hydratorClassName));

            $this->configuration->getGeneratorStrategy()->generate($traverser->traverse($generatedAst));
            $this->configuration->getGeneratedClassAutoloader()->__invoke($hydratorClassName);
        }

        return $hydratorClassName;
    }
195166
public function setDriver($driver)
    {
        $class = $this->wei->getClass($driver);

        if (!class_exists($class)) {
            throw new \InvalidArgumentException(sprintf('Cache driver class "%s" not found', $class));
        }

        if (!is_subclass_of($class, 'Wei\BaseCache')) {
            throw new \InvalidArgumentException(sprintf('Cache driver class "%s" must extend "Wei\BaseCache"', $class));
        }

        $this->driver = $driver;
        $this->object = $this->wei->get($driver);
        return $this;
    }
364623
public static function getProvider($classname) {
		if (array_key_exists($classname, self::$providers)) {
			return self::$providers[$classname];
		}
		
		$provider = new $classname;
		
		if (!($provider instanceof ServiceProviderInterface)) {
			throw new \InvalidArgumentException("$classname is not a valid ServiceProviderInterface instance");
		}

		self::$providers[$classname] = $provider;
		return self::$providers[$classname];
	}
378156
protected function getHandler()
    {
        if ($this->builder) {
            return $this->builder;
        }

        if ($this->query) {
            return $this->query;
        }

        throw new InvalidArgumentException('Missing query builder');
    }
39633
public function getCacheAdapter()
    {
        if (!$this->cacheAdapter) {
            $this->setCacheAdapter(new Cache\Adapter\FileSystem());
        }

        return $this->cacheAdapter;
    }
439027
public function getIterator(): \Iterator
    {
        $hydrator = $this->documentManager->newHydrator($this->hydrationMode);
        $query = clone $this->query;

        if (! $query->hasParam('_source')) {
            /** @var DocumentMetadata $class */
            $class = $this->documentManager->getClassMetadata($this->documentClass);
            $query->setSource($class->eagerFieldNames);
        }

        if (null !== $this->sort) {
            $query->setSort($this->sort);
        }

        if (null !== $this->limit) {
            $query->setSize($this->limit);
        }

        if (null !== $this->offset) {
            $query->setFrom($this->offset);
        }

        $generator = null !== $this->cacheProfile ? $this->_doExecuteCached($query) : $this->_doExecute($query);
        foreach ($generator as $resultSet) {
            yield from $hydrator->hydrateAll($resultSet, $this->documentClass);
        }
    }
1019442
protected Object getCacheManager() {
        CacheManager cacheManager = CacheManager.getInstance();
        if (cacheManager != null)
            return cacheManager;
        return CacheManager.newInstance();
    }
1037567
public function getDriver()
    {
        if (null != $this->driver) {
            return $this->driver;
        }

        switch($this->config['driver']) {
            case "file":
                $this->driver   = $this->createFileDriver();
                break;
            case "memcached":
                $this->driver   = $this->createMemcacheDriver();
                break;
            case "redis":
                $this->driver   = $this->createRedisDriver();
                break;
            default:
                throw new SessionException("Driver [{$this->config['driver']}] not supported.");
        }

        return $this->driver;
    }
777054
protected function createDriver($driver)
    {
        if (isset($this->initialDrivers[$driver])) {
            $provider = $this->initialDrivers[$driver];
            $provider = __NAMESPACE__.'\\Providers\\'.$provider.'Provider';

            return $this->buildProvider($provider, $this->formatConfig($this->config->get($driver)));
        }

        if (isset($this->customCreators[$driver])) {
            return $this->callCustomCreator($driver);
        }

        throw new InvalidArgumentException("Driver [$driver] not supported.");
    }
952816
public function produce()
    {
        $cacheFactory = null;
        foreach($this->cacheFactories as $factory)
        {
            if(false === $factory instanceof CacheFactoryInterface) {
                throw new \InvalidArgumentException("Array of Cache Factories must contain valid CacheFactory objects.");
            }
            
            if($this->type == $factory->getType()) {
                $cacheFactory = $factory;
                break;
            }
        }
        
        if(null === $cacheFactory)
        {
            throw ConfigException::cacheFactoryNotFound($this->type);
        }
            
        $cache = $cacheFactory->newInstance($this->app);
        
        if(false === $cache instanceof CacheInterface) {
            throw new \InvalidArgumentException("Cache factory must produce a valid CacheInterface object.");
        }
        
        return $cache;
    }