Get a cache item for a call to match().

@param string $pathinfo

@return \Psr\Cache\CacheItemInterface
350638
private function getCacheItemMatch($pathinfo)
    {
        /** @type RequestContext $c */
        $c   = $this->getContext();
        $key = sprintf('%s__%s__%s__%s', $c->getHost(), $pathinfo, $c->getMethod(), $c->getQueryString());

        return $this->getCacheItemFromKey($key, 'match');
    }
175393
protected final function poolGetItem(string $key): CacheItemInterface
    {
        try {
            $stream = new Stream(
                $this->includePath . $this->getTarget($key),
                Stream::MODE_C_MORE);
            $serialized = $stream->__toString();
            $stream->detach();
            if ($serialized) {
                $item = unserialize($serialized);
                if (is_object($item) && $item instanceof CacheItem) {
                    return $item;
                }
            }
            throw new InvalidArgumentException("Item must implement psr-6");
        } catch (InvalidArgumentException $e) {
            return $this->createItem($key);
        }
    }
18457
protected function getETag(CacheItemInterface $cacheItem)
    {
        $data = $cacheItem->get();

        foreach ($data['etag'] as $etag) {
            if (!empty($etag)) {
                return $etag;
            }
        }
    }
392616
private function getUri($pathinfo, $urlType = RouteCollection::DEFAULT_URL)
    {
        return $this->routeCollection->getUri($pathinfo, null, null, $urlType);
    }
768924
public function getItem($key)
    {
        if (!$this->exists($key)) {
            return new CacheItem($key);
        }

        $data = $this->read($this->fetchStreamUri($key));

        $item = new CacheItem($key);

        if ($this->denyAccess) {
            $data = substr($data, strlen($this->options['deny_code']));
        }

        $item->set($data);

        return $item;
    }
475459
public function getItemStorage()
    {
        // Hack for weird initialization logic
        if (!$this->itemStorage) {
            $this->itemStorage = new CacheItemStorage(
                $this->cacheAdapter ?: $this->getDefaultCacheAdapter(),
                $this->config->getCacheExpirationInSeconds()
            );
        }

        return $this->itemStorage;
    }
1013602
public static FileInfo fromItemInfo(PathCodec pathCodec, GoogleCloudStorageItemInfo itemInfo) {
    if (itemInfo.isRoot()) {
      return ROOT_INFO;
    }
    URI path = pathCodec.getPath(itemInfo.getBucketName(), itemInfo.getObjectName(), true);
    return new FileInfo(path, itemInfo);
  }
396337
protected function findFilesInCacheDir($pattern)
    {
        $finder = new Finder();
        
        return $finder
            ->name($pattern)
            ->in($this->getCacheDir())
        ;
    }
1191515
public function extractPathInfo($pathInfo)
    {
        if ($this->getRegex() === null) {
            return $pathInfo;
        }

        preg_match($this->getRegex(), $pathInfo, $matches);

        if (isset($matches[1])) {
            return $matches[1];
        } else {
            // Empty     then root node ("/" or "/edit)
            return "/";
        }
    }
887806
private function getCachedContent()
    {
        $item = null;

        if (null !== $this->cache) {
            $item = $this->cache->getItem($this->cacheKey);
            $cacheContent = $item->get();

            if ($item->isHit() && null !== $cacheContent) {
                $this->contentCache = $cacheContent;
            }
        }

        return $item;
    }
926964
public function isMatch($pathInfo)
	{
		$this->compile();

		$pathInfo = trim($pathInfo, '/');

		if (!preg_match($this->pattern, $pathInfo, $paramValues))
		{
			return false;
		}

		foreach ($this->paramNames as $name)
		{
			$this->params[$name] = isset($paramValues[$name]) ? urldecode($paramValues[$name]) : null;
		}

        return true;
	}
751956
public function match($pathinfo)
    {
        // Template router only accepts GET or HEAD requests
        if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
            throw new MethodNotAllowedException(array('GET', 'HEAD'));
        }

        $return = null;

        // Resolve the template and make sure it's routable
        $template = $this->resolver->resolveTemplate(rawurldecode($pathinfo));

        if ((false !== $template) && $this->isRoutableTemplate($template)) {
            $return = array(
                '_controller' => $this->controller,
                '_route' => $template->getRenderName(),
                'template' => $template,
            );
        }

        if ($return) {
            return($return);
        } else {
            throw new ResourceNotFoundException();
        }
    }
919927
protected function getFromCache($class, $path)
    {
        if (!isset($this->classCache[$class])) {
            return null;
        }

        if (!$path) {
            return $this->classCache[$class];
        }

        if (!isset($this->pathCache[$class])) {
            $this->putAllIntoCache($class, $this->classCache[$class]);
        }

        if (isset($this->pathCache[$class][$path])) {
            return $this->pathCache[$class][$path];
        }

        if (!strpos($path, '.')) {
            return null;
        }

        $segments = explode('.', $path);

        $type = null;
        $currentClass = $class;

        foreach ($segments as $segment) {

            if (!$type = $this->getFromCache($currentClass, $segment)) {
                 return null;
            }

            if ($type instanceof ObjectType) {
                $currentClass = $type->class;
            }

            if (!$type instanceof HasTypedItems) {
                continue;
            }

            if ($type->itemType instanceof ObjectType) {
                $currentClass = $type->itemType->class;
            }

        }

        return $type;

    }
1293564
public function rewritePathInfo($pathInfo)
    {
        if (($pathInfo != $this->getPathInfo()) && ($this->_rewritedPathInfo === null)) {
            $this->_rewritedPathInfo = explode('/', trim($this->getPathInfo(), '/'));
        }
        $this->setPathInfo($pathInfo);
        return $this;
    }
1172029
private function getCache($configPath)
  {
    if (!isset($this->cacheList[$configPath])) {
      $cachePath = $this->getCachePath($configPath);
      $this->cacheList[$configPath] = new ConfigCache($cachePath, true);
    }

    return $this->cacheList[$configPath];
  }
886320
public function getItemsPerPage()
    {
        $searchRequest = new StickyRequest('file_manager_folder');
        $searchParams = $searchRequest->getSearchRequest();
        $node = empty($searchParams['folder']) ? null : Node::getByID($searchParams['folder']);

        if (($node instanceof SearchPreset)) {
            $searchObj = $node->getSavedSearchObject();

            return $searchObj->getQuery()->getItemsPerPage();
        }

        $sessionQuery = $this->getSessionCurrentQuery();
        if ($sessionQuery instanceof \Concrete\Core\Entity\Search\Query) {
            return (int) $sessionQuery->getItemsPerPage();
        }

        $itemsPerPageSession = $this->getItemsPerPageSession();
        if (!empty($itemsPerPageSession)) {
            return $itemsPerPageSession;
        }

        $app = Application::getFacadeApplication();
        $config = $app->make('config');

        return $config->get('concrete.file_manager.results');
    }
852603
public function get($cacheKey)
    {
        // TODO: Refactor for strict types!
        $path = $this->resolvePath($cacheKey, false);
        if (file_exists($path)) {
            return file_get_contents($path);
        }

        return null;
    }