FileCacheItemPool
final class FileCacheItemPool implements CacheItemPoolInterface (View source)
| internal | Resolve the configured pool through CacheItemPoolInterface so application path boundaries are supplied. |
Persists PSR-6 values in authenticated, non-executable files below one private cache root.
Serialized PHP values are restored only after the complete envelope and its HMAC have been verified.
Constants
| private FORMAT_VERSION |
|
| private DEFAULT_MAX_FILE_BYTES |
|
| private DEFAULT_MAX_SERIALIZATION_DEPTH |
|
| private KEY_BYTES |
|
| private CREATE_ATTEMPTS |
|
| private FILE_PREFIX |
|
| private FILE_SUFFIX |
|
| private LOCAL_KEY_FILE |
|
Methods
Binds cache persistence to a private directory and configures authenticated payload limits.
Loads one authenticated payload, returning a miss for absent, expired, corrupted, or modified state.
Returns requested entries keyed by their original cache keys.
Reports whether a live, authenticated payload exists for the validated key.
Removes only authenticated-format files whose names belong to this pool namespace.
Removes one persisted or deferred entry without following a symbolic link at its managed path.
Removes each requested entry and reports whether every deletion succeeded.
Serializes and authenticates one framework cache item before atomically replacing its managed file.
Queues a framework cache item for a later commit without writing its payload yet.
Writes every deferred payload and reports whether all saves succeeded.
Details
__construct
__construct(string $directory, DirectoryManagerInterface $directoryManager, string|null $applicationSecret = null, string $namespace = 'lemonade', string|null $keyFile = null, string|null $storageRoot = null, string|null $publicRoot = null, int $maxFileBytes = self::DEFAULT_MAX_FILE_BYTES, int $maxSerializationDepth = self::DEFAULT_MAX_SERIALIZATION_DEPTH)
Binds cache persistence to a private directory and configures authenticated payload limits.
The first two arguments preserve the original construction API. Framework-managed instances additionally provide application boundaries so configured paths cannot leave storage or overlap the public web root.
getItem
CacheItemInterface
getItem(string $key)
Loads one authenticated payload, returning a miss for absent, expired, corrupted, or modified state.
getItems
iterable
getItems(array $keys = [])
Returns requested entries keyed by their original cache keys.
hasItem
bool
hasItem(string $key)
Reports whether a live, authenticated payload exists for the validated key.
clear
bool
clear()
Removes only authenticated-format files whose names belong to this pool namespace.
Legacy PHP files, local integrity keys, other pools, and unrelated files are left untouched.
deleteItem
bool
deleteItem(string $key)
Removes one persisted or deferred entry without following a symbolic link at its managed path.
deleteItems
bool
deleteItems(array $keys)
Removes each requested entry and reports whether every deletion succeeded.
save
bool
save(CacheItemInterface $item)
Serializes and authenticates one framework cache item before atomically replacing its managed file.
Serialization failures or values exceeding the configured file limit return false without publication.
saveDeferred
bool
saveDeferred(CacheItemInterface $item)
Queues a framework cache item for a later commit without writing its payload yet.
commit
bool
commit()
Writes every deferred payload and reports whether all saves succeeded.