28 $this->stash = $stash;
32 public function get(
$key, callable $callback = null,
$default = null) {
33 assert(is_string(
$key) || is_int(
$key));
35 $item = $this->stash->getItem((
string)
$key);
39 if (
$item->isMiss()) {
46 $result = call_user_func($callback);
56 assert(is_string(
$key) || is_int(
$key));
58 $this->stash->getItem((
string)
$key)->clear();
63 assert(is_string(
$key) || is_int(
$key));
65 $this->stash->getItem((
string)
$key)->set(
$value);
Defers to Stash for the meat of the caching logic.
__construct(Stash\Pool $stash)
Constructor.
static createEphemeral()
Create an in-memory implementation of the pool.
http free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use