FileStorage
class FileStorage implements Storage
Cache file storage.
Constants
| private internal MetaHeaderLen |
|
| private internal MetaTime |
|
| private internal MetaSerialized |
|
| private internal MetaExpire |
|
| private internal MetaDelta |
|
| private internal MetaItems |
|
| private internal MetaCallbacks |
|
| private File |
additional cache structure |
| private Handle |
additional cache structure |
Properties
| static | $gcProbability | Probability (0-1) that the garbage collector runs on each instantiation. |
Methods
No description
Reads item from the cache. Returns null if the item does not exist or has expired.
Prevents item reading and writing. Lock is released by write() or remove().
No description
Removes item from the cache.
No description
Opens and locks a cache file and reads its metadata.
Reads cache data from disk and closes cache file handle.
Returns the file path for a given cache key.
Details
at line 58
__construct(string $dir, Journal|null $journal = null)
No description
at line 73
mixed
read(string $key)
Reads item from the cache. Returns null if the item does not exist or has expired.
at line 122
void
lock(string $key)
Prevents item reading and writing. Lock is released by write() or remove().
at line 140
void
write(string $key, mixed $data, array $dp)
No description
at line 221
void
remove(string $key)
Removes item from the cache.
at line 229
void
clean(array $conditions)
No description
at line 301
protected array|null
readMetaAndLock(string $file, int $lock)
Opens and locks a cache file and reads its metadata.
at line 332
protected mixed
readData(array $meta)
Reads cache data from disk and closes cache file handle.
at line 348
protected string
getCacheFile(string $key)
Returns the file path for a given cache key.