9 abstract class BaseCache implements \ArrayAccess {
16 private array $variables = [];
29 $this->variables[$variable] =
$value;
40 return $this->variables[$variable] ?? null;
51 return $this->
load($key);
74 return (
bool) $this->
load($key);
97 abstract public function save(
$key,
$data, $expire_after = null);
106 abstract public function load(
$key);
115 abstract public function delete(
$key);
122 abstract public function clear();
136 abstract public function purge();
144 $this->disabled =
true;
152 $this->disabled =
false;
163 public function populate(array $values,
int $expires_after = null):
void {
181 if (!isset($this[$key])) {
200 #[\ReturnTypeWillChange] 214 #[\ReturnTypeWillChange] 228 #[\ReturnTypeWillChange] 244 #[\ReturnTypeWillChange] add(string $key, $data)
Add a key only if it doesn't already exist.
enable()
Enable disabled cache.
__isset(string $key)
Supporting isset, using $this->load() with default values.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
clear()
Clear out all the contents of the cache.
disable()
Disable cache Do not write or read from cache.
if(!$entity instanceof\ElggUser) $data
offsetUnset($offset)
Unsets a key.
__set(string $key, $value)
Class member set overloading, setting a key using $this->save defaults.
offsetSet($offset, $value)
Assigns a value for the specified key.
__unset(string $key)
Supporting unsetting of magic attributes.
load($key)
Load data from the cache using a given key.
The Elgg cache base class.
invalidate()
Invalidate the contents of the cache.
__get(string $key)
Class member get overloading, returning key using $this->load defaults.
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
setVariable(string $variable, $value)
Set a cache variable.
offsetExists($offset)
Does key exist.
purge()
Purge old/stale contents of the cache.
offsetGet($offset)
Get the value for specified key.
getVariable(string $variable)
Get variables for this cache.
save($key, $data, $expire_after=null)
Save data in a cache.
populate(array $values, int $expires_after=null)
Populate cache from an array of key => values.