Get the cache provider.  First checks to see if the provider is callable,
then will attempt to get it from the service locator, finally will fallback
to a class mapper.

@param $path

@return array
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);
    }
1144658
public function find($path)
    {
        $language = $this->getLanguage();
        $fallback = $this->getLanguageFallback();
        $locator  = $this->getObject('translator.locator.factory')->createLocator($path);

        $results = [];

        // Try to load the fallback translations first
        if ($fallback && $fallback != $language)
        {
            if ($result = $locator->locate($path .'/'.$fallback.'/'.$fallback.'.*')) {
                $results[] = $result;
            }
        }

        // Find translations based on the language
        if ($result = $locator->locate($path .'/'.$language.'/'.$language.'.*')) {
            $results[] = $result;
        }

        return $results;
    }
819925
public function getByPath($path)
    {
        $extension = pathinfo($path, PATHINFO_EXTENSION);
        if ('' === $extension) {
            $extension = null;
        }

        return $this->get($extension);
    }
1196625
public function getLocatorPath($path)
	{
		if (!isset($this->locator->$path))
		{
			return false;
		}

		return $this->locator->$path;
	}
127276
public static function getHandlerByPath($path)
    {
        $result = null;
        $path   = self::prepareRoute('/'.trim($path, " /"));

        foreach (static::$routes as $key => $handler) {
            $matches = [];
            if (preg_match('#'.$key.'$#i', $path, $matches)) {
                foreach ($matches as $key => $val) {
                    if (!is_numeric($key)) {
                        $_GET[$key] = $val;
                    }
                }
                $result = $handler[1];
                break;
            }
        }
        return $result;
    }
57063
protected function _getProcessor($path)
    {
        if (!$path) {
            return;
        }

        if (!is_array(static::$processorcache)) {
            static::$processorcache = array();
        }

        if (array_key_exists($path, static::$processorcache)) {
            return static::$processorcache[$path];
        }

        foreach ($this->processors as &$processor) {

            /* @var $processor AbstractFileProcessor */
            $config = $processor->getConfig();

            if (preg_match($config['file'], $path)) {
                static::$processorcache[$path] = $processor;

                return $processor;
            }
        }
    }
561898
public function getThemeUrl($path = '')
    {
        if (!is_null($path) && ! is_bool($path) && ! is_string($path) && !is_numeric($path)) {
            $path = is_resource($path) ? '' : gettype($path);
        }

        $path = (string) $path;
        if (!isset($this->cachedPath)) {
            $this->cachedPath = substr($this->getThemePath(), strlen(dirname($_SERVER['SCRIPT_FILENAME'])));
        }

        $path = $this->cachedPath . ltrim($path, '/');
        return $this->getBaseUrl($path);
    }
474588
public function getSource($path)
    {
        try {
            // The "loaded_by_puli" tag makes it possible to recognize node
            // trees of templates loaded through this loader. In this way, we
            // can turn relative Puli paths into absolute ones in those
            // templates. The "loaded_by_puli" tag is removed early on by the
            // PuliDirTagger visitor and does not appear in the final
            // output.
            return '{% loaded_by_puli %}'.$this->getResource($path)->getBody();
        } catch (ResourceNotFoundException $e) {
            throw new Twig_Error_Loader($e->getMessage(), -1, null, $e);
        } catch (InvalidArgumentException $e) {
            throw new Twig_Error_Loader($e->getMessage(), -1, null, $e);
        }
    }
744430
public function getFinder($path = '')
    {
        if (($protocol = array_search($this, self::$registeredWrappers))
            === false
        ) {
            $protocol = $this->registerStreamWrapper(null);
        }

        $path   = sprintf(
            "%s://%s/%s",
            $protocol,
            $this->getBucket(),
            $this->applyPathPrefix($path)
        );
        $finder = new Finder();
        $finder->in($path);

        return $finder;
    }
227014
public function get ($path) {
		list ($first, $rest) = self::getFirstAndRestPathElements($path);

		if (array_key_exists($first, $this -> data)) {
			$value = $this -> data[$first];
			if (is_null($rest)) {
				return $value;
			} else if ($value instanceof TreeInterface) {
				return $value -> get($rest);
			} else {
				throw new InvalidKeyException("Value at key `" . $first . "` is a scalar; cannot step further down the requested path `" . $rest . "`");
			}
		} else {
			throw new NonExistentKeyException("Key `" . $first . "` does not exist.");
		}
	}
342525
public static function lookupByPath($path)
    {
        if (empty($path)) {
            throw new \InvalidArgumentException('Argument "path" cannot be empty');
        }

        foreach (self::$methods_config as $key => $val) {
            if ($val['path'] === $path) {
                return $val;
            }
        }

        return null;
    }
703074
public static function driversIn($path)
    {
        if (! is_dir($path)) {
            return [];
        }

        $drivers = [];

        $dir = new RecursiveDirectoryIterator($path);
        $iterator = new RecursiveIteratorIterator($dir);
        $regex = new RegexIterator($iterator, '/^.+ValetDriver\.php$/i', RecursiveRegexIterator::GET_MATCH);

        foreach ($regex as $file) {
            require_once $file[0];

            $drivers[] = basename($file[0], '.php');
        }

        return $drivers;
    }
543509
public function back_getCatCacheKeys($path)
    {
        $result = CatCacheRpcProxy::getRpc()->getKeys($path);
        $this->autoSend($result);
    }
342742
public function load($path)
    {
        $path = $this->findAbsolutePath($path);

        if ($this->cache) {
            if ($this->cache->isFresh($path, filemtime($path))) {
                $feature = $this->cache->read($path);
            } elseif (null !== $feature = $this->parseFeature($path)) {
                $this->cache->write($path, $feature);
            }
        } else {
            $feature = $this->parseFeature($path);
        }

        return null !== $feature ? array($feature) : array();
    }
92841
public function load($path)
    {
        $path = $this->findAbsolutePath($path);

        $iterator = new RecursiveIteratorIterator(
            new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS)
        );
        $paths = array_map('strval', iterator_to_array($iterator));
        uasort($paths, 'strnatcasecmp');

        $features = array();

        foreach ($paths as $path) {
            $path = (string) $path;
            $loader = $this->gherkin->resolveLoader($path);

            if (null !== $loader) {
                $features = array_merge($features, $loader->load($path));
            }
        }

        return $features;
    }
422244
private function loadFromCache($path)
    {
        if ($this->getCache()) {
            return $this->getCache()->read(self::CACHE_KEY . md5($path));
        }

        return false;
    }
327041
public function getObject($path)
    {
        if ($path === '' || $path === '.') {
            return $this;
        }
        $data = $this->getObjectData($path);
        if ($data === false) {
            return false;
        }

        if ($data['type'] === 'blob') {
            return Blob::fromSha($data['sha'], $this->getUri(), $this->client);
        } elseif ($data['type'] === 'tree') {
            return Tree::fromSha($data['sha'], $this->getUri(), $this->client);
        }

        throw new \RuntimeException('Unrecognised object type: ' . $data['type']);
    }