PhpCapableBackendInterface
interface PhpCapableBackendInterface implements BackendInterface (View source)
A contract for a cache backend which is capable of storing, retrieving and including PHP source code.
Methods
Returns the internally used, prefixed entry identifier for the given public entry identifier.
Saves data in the cache.
Checks if a cache entry with the specified identifier exists.
Removes all cache entries matching the specified identifier.
Loads PHP code from the cache and require_onces it right away.
Details
void
setCache(FrontendInterface $cache)
Sets a reference to the cache frontend which uses this backend
string
getPrefixedIdentifier(string $entryIdentifier)
Returns the internally used, prefixed entry identifier for the given public entry identifier.
While Flow applications will mostly refer to the simple entry identifier, it may be necessary to know the actual identifier used by the cache backend in order to share cache entries with other applications. This method allows for retrieving it.
void
set(string $entryIdentifier, string $data, array $tags = [], int $lifetime = null)
Saves data in the cache.
mixed
get(string $entryIdentifier)
Loads data from the cache.
bool
has(string $entryIdentifier)
Checks if a cache entry with the specified identifier exists.
bool
remove(string $entryIdentifier)
Removes all cache entries matching the specified identifier.
Usually this only affects one entry but if - for what reason ever - old entries for the identifier still exist, they are removed as well.
void
flush()
Removes all cache entries of this cache.
void
collectGarbage()
Does garbage collection
mixed
requireOnce(string $entryIdentifier)
Loads PHP code from the cache and require_onces it right away.