\phpDocumentor\Parser\CacheLocator

Locates the cache folder and ensures that the Symfony Cache is routed to that folder.

Contrary to the way Symfony regularly works, the cache folder can be provided by the configuration and should be set at runtime.

This class plays two roles in this process:

  1. It exposes a Path that can dynamically change, this will allow other services not to depend on an actual path being passed in their constructor (which is cached by Symfony!) but this service so that their cache actions use the folder that is provided at runtime.
  2. It will initialize the Symfony Cache pools on runtime

As long as all components that want to cache use this class; then that will ensure that cache is always written to the same location.

Caveat: this class does not change the location of the Symfony 'app' and 'system' cache pools by design; the Symfony internal cache is still stored in folder dictated by {@see \phpDocumentor\Kernel::getCacheDir()}.

Summary

Methods
Properties
Constants
__construct()
providePath()
locate()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
root()
$path
$fileCache
$descriptorCache
N/A

Properties

$path

$path : ?\phpDocumentor\Path

Type

?\phpDocumentor\Path

$fileCache

$fileCache : \Symfony\Contracts\Cache\CacheInterface&\phpDocumentor\Parser\Cache\FilesystemAdapter

Type

\Symfony\Contracts\Cache\CacheInterface&\phpDocumentor\Parser\Cache\FilesystemAdapter —

$descriptorCache

$descriptorCache : \Symfony\Contracts\Cache\CacheInterface&\phpDocumentor\Parser\Cache\FilesystemAdapter

Type

\Symfony\Contracts\Cache\CacheInterface&\phpDocumentor\Parser\Cache\FilesystemAdapter —

Methods

__construct()

__construct(\Symfony\Contracts\Cache\CacheInterface  $files, \Symfony\Contracts\Cache\CacheInterface  $descriptors) : mixed

Parameters

\Symfony\Contracts\Cache\CacheInterface $files
\Symfony\Contracts\Cache\CacheInterface $descriptors

Returns

mixed —

providePath()

providePath(\phpDocumentor\Path  $path) : void

Parameters

\phpDocumentor\Path $path

locate()

locate(string  $namespace = '') : \phpDocumentor\Path

Parameters

string $namespace

Returns

\phpDocumentor\Path —

root()

root() : \phpDocumentor\Path

Returns

\phpDocumentor\Path —