VariableFrontend
class VariableFrontend extends AbstractFrontend (View source)
A cache frontend for any kinds of PHP variables
Properties
protected string | $identifier | Identifies this cache |
from AbstractFrontend |
protected BackendInterface | $backend | from AbstractFrontend | |
protected bool | $useIgBinary | If the extension "igbinary" is installed, use it for increased performance. |
Methods
Initializes this cache frontend
Checks if a cache entry with the specified identifier exists.
Removes the given cache entry from the cache.
Removes all cache entries of this cache which are tagged by the specified tag.
Checks the validity of an entry identifier. Returns true if it's valid.
Checks the validity of a tag. Returns true if it's valid.
Saves the value of a PHP variable in the cache. Note that the variable will be serialized if necessary.
Finds and returns a variable value from the cache.
Finds and returns all cache entries which are tagged by the specified tag.
Returns an iterator over the entries of this cache
Details
__construct(string $identifier, BackendInterface $backend)
Constructs the cache
void
initializeObject()
Initializes this cache frontend
string
getIdentifier()
Returns this cache's identifier
BackendInterface
getBackend()
Returns the backend used by this cache
bool
has(string $entryIdentifier)
Checks if a cache entry with the specified identifier exists.
bool
remove(string $entryIdentifier)
Removes the given cache entry from the cache.
void
flush()
Removes all cache entries of this cache.
int
flushByTag(string $tag)
Removes all cache entries of this cache which are tagged by the specified tag.
void
collectGarbage()
Does garbage collection
bool
isValidEntryIdentifier(string $identifier)
Checks the validity of an entry identifier. Returns true if it's valid.
bool
isValidTag(string $tag)
Checks the validity of a tag. Returns true if it's valid.
void
set(string $entryIdentifier, mixed $variable, array $tags = [], int $lifetime = null)
Saves the value of a PHP variable in the cache. Note that the variable will be serialized if necessary.
mixed
get(string $entryIdentifier)
Finds and returns a variable value from the cache.
array
getByTag(string $tag)
Finds and returns all cache entries which are tagged by the specified tag.
CacheEntryIterator
getIterator()
Returns an iterator over the entries of this cache