Interface StorageInterface
An interface for classes implementing storage capabilities.
Methods summary
public
store( string $key
, mixed $value
, string $ttl
= null )
Stores a variable.
Parameters
$key
Store the variable using this name. keys are cache-unique, so storing
a second value with the same key will overwrite the original value.
$value
- The value to store.
$ttl
Time To Live; store value
in the cache for ttl
seconds. After the
ttl
has passed, the stored value won't be available for the next request. If no ttl
is
supplied (or if the ttl
is empty), the value will persist until it is removed from the
cache manually, or otherwise fails to exist in the cache.
public
retrieve( string $key
)
: mixed|null
Retrieves a value.
Parameters
Returns
mixed|null
The value associated with the key, or null
if the key doesn't exists.
public
eliminate( string $key
)
Removes a value and its key.
Removes a value and its key.
Parameters
public
exists( string $key
)
: boolean
Checks if a key exists.
Parameters
Returns
boolean
true
if the key exists, false
otherwise.