RuntimeInputsResultCacheValueExtension
class RuntimeInputsResultCacheValueExtension implements ResultCacheValueExtension
The inputs the booted application was built from: the files the boot ran or read, the environment variables it can read and the files whose presence it checks.
PHPStan compares cached values before anything boots, so the value is computed from the key alone. One aggregated value keeps each boot-derived lookup to a single dependency record. Paths under the working directory are relative, which keeps the key small (PHPStan hashes it on every record) and lets the result cache survive a moved checkout.
Constants
| private FILE |
|
| private PRESENCE |
|
| private DIRECTORY_PRESENCE |
|
| private DIRECTORY |
|
| private LINKED_DIRECTORY |
|
| private LISTING |
|
| private VARIABLE |
|
| private VARIABLE_PATTERN |
|
Methods
Create a new extension instance.
Create the key for the given inputs.
Get the digest of a file's contents, or 'missing'.
Get the digest of the names and contents of the files in a directory, recursively, whose names match the pattern.
Get the digest of the names of the files in a directory, recursively, or 'missing'.
Get the current value for the key.
Get the key as the result cache stores it; its paths are already relative to the working directory.
Get the key back from the result cache.
Details
at line 71
__construct(string $workingDirectory)
Create a new extension instance.
at line 89
string
createKey(array $files = [], array $presenceFiles = [], array $presenceDirectories = [], array $directories = [], array $linkedDirectories = [], array $listings = [], array $variables = [], array $variablePatterns = [])
Create the key for the given inputs.
at line 125
static string
fileDigest(string $path)
Get the digest of a file's contents, or 'missing'.
at line 133
static string
directoryDigest(string $directory, string $pattern, bool $followLinks = false)
Get the digest of the names and contents of the files in a directory, recursively, whose names match the pattern.
at line 153
static string
listingDigest(string $directory)
Get the digest of the names of the files in a directory, recursively, or 'missing'.
The view finder finds views through symlinked directories, so the listing follows them.
at line 161
string
getValue(string $key)
Get the current value for the key.
at line 193
string
keyToResultCache(string $key)
Get the key as the result cache stores it; its paths are already relative to the working directory.
at line 201
string
keyFromResultCache(string $storedKey)
Get the key back from the result cache.