|
| __construct (string $module='repository') |
| Constructor for class cache_handler.
|
|
| clear () |
| Deletes all items in the pool.
|
|
| commit () |
| Persists any deferred cache items.
|
|
| delete_item (string $key) |
| Removes the item from the pool.
|
|
| delete_items (array $keys) |
| Removes multiple items from the pool.
|
|
| get_item (string$key, ?int $ttl=null) |
| Returns a Cache Item representing the specified key.
|
|
| get_items (array $keys=[]) |
| Returns a traversable set of cache items.
|
|
| has_item ($key) |
| Confirms if the cache contains specified cache item.
|
|
| refresh (int $ttl) |
| Refreshes all items in the pool.
|
|
| save (cache_item $item) |
| Persists a cache item immediately.
|
|
| save_deferred (cache_item $item) |
| Sets a cache item to be persisted later.
|
|
◆ __construct()
core\local\guzzle\cache_handler::__construct |
( |
string | $module = 'repository' | ) |
|
Constructor for class cache_handler.
This class will accept the module which will determine the location of cached files.
- Parameters
-
string | $module | module string for cache directory. |
◆ clear()
core\local\guzzle\cache_handler::clear |
( |
| ) |
|
Deletes all items in the pool.
- Return values
-
bool | True if the pool was successfully cleared. False if there was an error. |
◆ commit()
core\local\guzzle\cache_handler::commit |
( |
| ) |
|
Persists any deferred cache items.
- Return values
-
bool | True if all not-yet-saved items were successfully saved or there were none. False otherwise. |
◆ delete_item()
core\local\guzzle\cache_handler::delete_item |
( |
string | $key | ) |
|
Removes the item from the pool.
- Parameters
-
string | $key | The key to delete. |
- Return values
-
bool | True if the item was successfully removed. False if there was an error. |
◆ delete_items()
core\local\guzzle\cache_handler::delete_items |
( |
array | $keys | ) |
|
Removes multiple items from the pool.
- Parameters
-
string[] | $keys | An array of keys that should be removed from the pool. |
- Return values
-
bool | True if the items were successfully removed. False if there was an error. |
◆ get_item()
core\local\guzzle\cache_handler::get_item |
( |
string$key | , |
|
|
?int | $ttl = null ) |
Returns a Cache Item representing the specified key.
This method must always return a CacheItemInterface object, even in case of a cache miss. It MUST NOT return null.
- Parameters
-
string | $key | The key for which to return the corresponding Cache Item.. |
int | null | $ttl | Number of seconds for the cache item to live. |
- Return values
-
◆ get_items()
core\local\guzzle\cache_handler::get_items |
( |
array | $keys = [] | ) |
|
Returns a traversable set of cache items.
- Parameters
-
string[] | $keys | An indexed array of keys of items to retrieve. |
- Return values
-
iterable | An iterable collection of Cache Items keyed by the cache keys of each item. A Cache item will be returned for each key, even if that key is not found. However, if no keys are specified then an empty traversable MUST be returned instead. |
◆ has_item()
core\local\guzzle\cache_handler::has_item |
( |
| $key | ) |
|
Confirms if the cache contains specified cache item.
Note: This method MAY avoid retrieving the cached value for performance reasons. This could result in a race condition with CacheItemInterface\get(). To avoid such situation use CacheItemInterface\isHit() instead.
- Parameters
-
string | $key | The key for which to check existence. |
- Return values
-
bool | True if item exists in the cache, false otherwise. |
◆ refresh()
core\local\guzzle\cache_handler::refresh |
( |
int | $ttl | ) |
|
Refreshes all items in the pool.
- Parameters
-
- Return values
-
◆ save()
core\local\guzzle\cache_handler::save |
( |
cache_item | $item | ) |
|
Persists a cache item immediately.
- Parameters
-
cache_item | $item | The cache item to save. |
- Return values
-
bool | True if the item was successfully persisted. False if there was an error. |
◆ save_deferred()
core\local\guzzle\cache_handler::save_deferred |
( |
cache_item | $item | ) |
|
Sets a cache item to be persisted later.
- Parameters
-
cache_item | $item | The cache item to save. |
- Return values
-
bool | False if the item could not be queued or if a commit was attempted and failed. True otherwise. |
The documentation for this class was generated from the following file:
- lib/classes/local/guzzle/cache_handler.php