41 parent::__construct(
$size);
52 $this->runtime_enabled =
true;
65 public function disable(
bool $clear =
true) {
66 $this->runtime_enabled =
false;
79 if ($this->config_disabled) {
92 $this->
getLogger()->info(
'Query cache invalidated');
105 $this->
getLogger()->info(
"DB query results returned from cache (hash: {$key})");
120 $this->
getLogger()->info(
"DB query results cached (hash: {$key})");
133 $query_id = $sql .
'|';
135 $query_id .= serialize(
$params) .
'|';
138 $query_id .= $extras;
141 return md5($query_id);
disable(bool $clear=true)
Disable the query cache.
getHash(string $sql, array $params=[], string $extras= '')
Returns a hashed key for storage in the cache.
__construct(int $size=50, bool $config_disabled=false)
$params
Saves global plugin settings.
Least Recently Used Cache.
enable()
Enable the query cache.
trait Loggable
Enables adding a logger.
Volatile cache for select queries.
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
getLogger()
Returns logger.
isEnabled()
Checks if this cache is enabled.