Gets a specific content handler

@param   string
@return  Cache_Handler_Driver
339298
public function get_content_handler($handler = null)
	{
		if ( ! empty($this->handler_object))
		{
			return $this->handler_object;
		}

		// When not yet set, use $handler or detect the preferred handler (string = string, otherwise serialize)
		if (empty($this->content_handler) && empty($handler))
		{
			if ( ! empty($handler))
			{
				$this->content_handler = $handler;
			}
			if (is_string($this->contents))
			{
				$this->content_handler = \Config::get('cache.string_handler', 'string');
			}
			else
			{
				$type = is_object($this->contents) ? get_class($this->contents) : gettype($this->contents);
				$this->content_handler = \Config::get('cache.'.$type.'_handler', 'serialized');
			}
		}

		$class = '\\Cache_Handler_'.ucfirst($this->content_handler);
		$this->handler_object = new $class();

		return $this->handler_object;
	}
476282
public static function getHandler($path)
    {
        $result = static::getHandlerByName($path);

        if ($result === null) {
            $result = static::getHandlerByPath($path);
        }

        if ($result === null) {
            $result = static::parseRoute($path);
        }

        return $result;
    }
223978
public function getAll($handle) {
		// set content type at first position so it will get overwritten by later definitions
		array_unshift($this->_header, 'Content-Type: text/html; charset=utf-8');
		$this->_header[] = 'Vary:';

		// use etag for content validation (only HTTP1.1)
		rewind($handle);
		$hash = hash_init('md5');
		hash_update_stream($hash, $handle);
		$hash = hash_final($hash);
		
		// add all user defined headers to hash
		// if we change one of those we also want to see the actual view
		$hash = md5($hash . implode('', $this->_header));
		
		if ($this->_cacheetag) $this->_header[] = 'ETag: '.$hash; // HTTP 1.1
		
		if ($this->_cachetime === null) {
			// no caching
			if ($this->_cacheetag) $this->_header[] = 'Cache-Control: no-cache, must-revalidate';
			else $this->_header[] = 'Cache-Control: no-store, no-cache, must-revalidate'; // to overwrite default php setting with "no-store"
		} else {
			// caching
			$fileexpired = strtotime($this->_cachetime);
			$filemaxage = $fileexpired-time();

			// HTTP 1.0
			$this->_header[] = 'Pragma: ';
			$this->_header[] = 'Expires: '.gmdate("D, d M Y H:i:s", $fileexpired) ." GMT";

			// HTTP 1.1
			$this->_header[] = 'Cache-Control: public, max-age='.$filemaxage;
		}

		// check for etag
		if (!isset($_SERVER['HTTP_CACHE_CONTROL']) || !preg_match('/max-age=0|no-cache/i', $_SERVER['HTTP_CACHE_CONTROL'])) // by-pass "not modified" on explicit reload
			if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == $hash) {
				$this->_etag_is_different = false;
				$this->_header[] = 'HTTP/1.1 304 Not Modified';
			}

		// set download header
		if (!empty($this->_filename)) {
			$this->_header[] = 'Content-Type: ' . $this->getMimeType($this->_filename);
			$this->_header[] = 'Content-Disposition: attachment; filename='.basename($this->_filename);
		}

		return $this->_header;
	}
732274
public function validateCacheHandler($driver, $handler)
    {
        $store = $handler->getCache()->getStore();
        return static::$expectedStores[$driver] !== get_class($store);
    }
232682
protected function _getCache($group = '', $handler = 'callback', $storage = null)
    {
        return JFactory::getCache($group, $handler, $storage);
    }
1180148
public function getCache() {
        if (!file_exists($this->_fileName)) {
            $this->setCache();
        }

        return unserialize(($this->_uncompress(file_get_contents($this->_fileName))));
    }
998822
public function getCachedContent()
    {
        if ($this->_content === null) {
            $this->_content = false;
            if ($this->cache instanceof Cache) {
                $key = $this->calculateKey();
                $data = $this->cache->get($key);
                if (is_array($data) && count($data) === 2) {
                    list ($content, $placeholders) = $data;
                    if (is_array($placeholders) && count($placeholders) > 0) {
                        if (empty($this->getView()->cacheStack)) {
                            // outermost cache: replace placeholder with dynamic content
                            $content = $this->updateDynamicContent($content, $placeholders);
                        }
                        foreach ($placeholders as $name => $statements) {
                            $this->getView()->addDynamicPlaceholder($name, $statements);
                        }
                    }
                    $this->_content = $content;
                }
            }
        }

        return $this->_content;
    }
714637
public function get(string $key): ?\BearFramework\App\CacheItem
    {
        $driver = $this->getDriver();
        $item = null;
        $value = $driver->get($key);
        if ($value !== null) {
            $item = $this->make($key, $value);
        }
        if ($this->hasEventListeners('itemGet')) {
            $this->dispatchEvent('itemGet', new \BearFramework\App\Cache\ItemGetEventDetails($key, $item === null ? null : clone($item)));
        }
        if ($this->hasEventListeners('itemRequest')) {
            $this->dispatchEvent('itemRequest', new \BearFramework\App\Cache\ItemRequestEventDetails($key));
        }
        return $item;
    }
1266721
public function cache($cache = null)
    {
        if ($cache === null) {
            return $this->_cache;
        }

        if ($cache === false) {
            $this->_cache = false;

            return $this;
        }

        if ($cache === true) {
            $cache = 'cake_pdf';
        }

        if (!in_array($cache, Cache::configured())) {
            throw new Exception(sprintf('CakePdf cache is not configured: %s', $cache));
        }

        $this->_cache = $cache;

        return $this;
    }
838728
public function getHandler($handlerName)
    {
        $prefix = SmartboxIntegrationFrameworkExtension::HANDLER_PREFIX.$handlerName;

        return $this->container->get($prefix);
    }
965505
public function getFor($name)
    {
        if (isset($this->cache[$name])) {
            return $this->cache[$name];
        }

        $handlers = $this->getHandlers(self::KEY_ALWAYS_LOADED);
        if ($name !== self::KEY_ALWAYS_LOADED) {
            $handlers = array_merge($handlers, $this->getHandlers($name));
        }

        $logger = new Logger($name, $handlers);
        ErrorHandler::register($logger);
        $this->cache[$name] = $logger;

        return $logger;
    }
391221
private function getDriver(): \BearFramework\App\ICacheDriver
    {
        if ($this->driver !== null) {
            return $this->driver;
        }
        throw new \Exception('No cache driver specified! Use useAppDataDriver() or setDriver() to specify one.');
    }
1318729
public function get($url, array $data = [], array $headers = [], $cacheMinutes = 0, HttpExceptionHandler $handler = null)
    {
        return $this->send('get', $url, $data, $headers, $cacheMinutes, $handler);
    }
1192430
public function getHandlerForType(string $type) : HandlerInterface
    {
        if ($this->hasHandlerForType($type)) {
            return $this->handlers[$type];
        }

        throw DataTypeException::handlerNotFound($type);
    }
915267
protected function createCacheHandler($driver)
    {
        $store = $this->app['config']->get('session.store') ?: $driver;

        $minutes = $this->app['config']['session.lifetime'];

        return new CacheBasedSessionHandler(clone $this->app['cache']->store($store), $minutes);
    }
1214500
public I_CmsXmlContentHandler getFreshContentHandler(String className) throws CmsXmlException {

        I_CmsXmlContentHandler contentHandler;
        // generate an instance for the content handler
        try {
            contentHandler = (I_CmsXmlContentHandler)Class.forName(className).newInstance();
        } catch (InstantiationException e) {
            throw new CmsXmlException(Messages.get().container(Messages.ERR_INVALID_CONTENT_HANDLER_1, className));
        } catch (IllegalAccessException e) {
            throw new CmsXmlException(Messages.get().container(Messages.ERR_INVALID_CONTENT_HANDLER_1, className));
        } catch (ClassCastException e) {
            throw new CmsXmlException(Messages.get().container(Messages.ERR_INVALID_CONTENT_HANDLER_1, className));
        } catch (ClassNotFoundException e) {
            throw new CmsXmlException(Messages.get().container(Messages.ERR_INVALID_CONTENT_HANDLER_1, className));
        }
        return contentHandler;
    }
1118224
public function getHandlerForType($type)
    {
        foreach ($this->handlers as $handler) {
            if ($handler->getType() == $type) {
                return $handler;
            }
        }

        return new FileHandler();
    }