ApplicationConfigCache
final class ApplicationConfigCache (View source)
Persists compiled configuration as authenticated data below private application storage.
Cache contents are never executed or passed to PHP deserialization. Invalid authenticated data is treated as a miss, while an unsafe filesystem boundary fails explicitly.
Constants
| private CACHE_VERSION |
|
| private KEY_BYTES |
|
| private CREATE_ATTEMPTS |
|
| private DEFAULT_MAX_FILE_BYTES |
|
| private DEFAULT_MAX_DATA_DEPTH |
|
| private DEFAULT_MAX_DATA_NODES |
|
| private CACHE_DIRECTORY |
|
| private KEY_DIRECTORY |
|
| private KEY_FILE |
|
| private KEY_INFO |
|
Methods
Configures defensive limits for the generated cache without requiring application settings.
Returns hydrated definitions only when the authenticated cache and all tracked inputs are fresh.
Atomically publishes an authenticated snapshot of definitions and their freshness metadata.
Details
__construct
__construct(int $maxFileBytes = self::DEFAULT_MAX_FILE_BYTES, int $maxDataDepth = self::DEFAULT_MAX_DATA_DEPTH, int $maxDataNodes = self::DEFAULT_MAX_DATA_NODES)
Configures defensive limits for the generated cache without requiring application settings.
loadIfFresh
array|null
loadIfFresh(ApplicationContext $context, string $entrypoint)
Returns hydrated definitions only when the authenticated cache and all tracked inputs are fresh.
Corrupted, modified, unsupported, or stale data produces a cache miss without invoking a cached class or executing cache contents.
write
void
write(ApplicationContext $context, string $entrypoint, array $definitions, array $sourceFiles, array $envKeys)
Atomically publishes an authenticated snapshot of definitions and their freshness metadata.