FileCache
in package
File-based cache engine implementation
Stores cache entries as serialized files
Tags
Table of Contents
Methods
- all() : array<string|int, cache|null>
- Get all cache entries
- clean() : void
- Clean expired cache entries
- delete() : void
- Delete a cache entry
- deleteAll() : false|null|string
- Delete all cache entries
- fetch() : cache|null
- Fetch a cache entry by key
- isPersistOk() : bool
- Check if persistence archive is valid
- persist() : void
- Persist cache to archive file
- restore() : void
- Restore cache from persistence archive
- save() : void
- Save a cache entry
Methods
all()
Get all cache entries
public
static all() : array<string|int, cache|null>
Return values
array<string|int, cache|null> —Array of cache objects
clean()
Clean expired cache entries
public
static clean() : void
delete()
Delete a cache entry
public
static delete(string $_key) : void
Parameters
- $_key : string
-
Cache key
deleteAll()
Delete all cache entries
public
static deleteAll() : false|null|string
Return values
false|null|string —Output of shell command or false/null on failure
fetch()
Fetch a cache entry by key
public
static fetch(string $_key) : cache|null
Parameters
- $_key : string
-
Cache key
Return values
cache|null —Cache object or null if not found
isPersistOk()
Check if persistence archive is valid
public
static isPersistOk() : bool
Return values
bool —True if persistence archive is valid
persist()
Persist cache to archive file
public
static persist() : void
restore()
Restore cache from persistence archive
public
static restore() : void
save()
Save a cache entry
public
static save(cache $_cache) : void
Parameters
- $_cache : cache
-
Cache object to save