83 return $this->cache->get(
$name,
function() use (
$name) {
85 $sql =
"SELECT * FROM {$this->table} WHERE name = :name";
117 INSERT INTO {$this->table}
118 SET name = :name, value = :value
119 ON DUPLICATE KEY UPDATE value = :value
127 $success = $this->db->insertData($sql,
$params);
131 return $success !==
false;
162 $lastupdated = $this->
get($functionname);
164 $lastupdated = (int) $lastupdated;
165 } elseif ($lastupdated !==
false) {
171 if (is_callable($functionname) && $lastupdated <= $timelastupdatedcheck) {
173 $this->
set($functionname,
time());
192 if (is_callable(
'mb_strlen')) {
199 $this->logger->error(
"The name length for configuration variables cannot be greater than $max");
if($guid==elgg_get_logged_in_user_guid()) $name
__construct(Pool $cache, Database $db, Logger $logger, $table)
Constructor.
setCache(Pool $pool)
Set cache.
validateName($name)
Verify a datalist name is valid.
runFunctionOnce($functionname, $timelastupdatedcheck=0)
Run a function one time per installation.