<?php
namespace Friendica\Core\Config\Adapter;
-use Friendica\Core\Logger;
use Friendica\Database\DBA;
/**
// manage array value
$value = (preg_match("|^a:[0-9]+:{.*}$|s", $config['v']) ? unserialize($config['v']) : $config['v']);
- if ($key === 'last_worker_execution') {
- Logger::alert('catchmeifyou', ['store' => $value, 'in_db' => $this->in_db[$cat][$key]]);
- }
-
if (isset($value) && $value !== '') {
$this->in_db[$cat][$key] = true;
return $value;
- } else {
- $this->in_db[$cat][$key] = false;
- return '!<unset>!';
}
- } else {
-
- $this->in_db[$cat][$key] = false;
- return '!<unset>!';
}
+
+ $this->in_db[$cat][$key] = false;
+ return '!<unset>!';
}
/**
$this->in_db[$cat][$key] = false;
}
- if ($key === 'last_worker_execution') {
- Logger::alert('catchmeifyou', ['db' => $dbvalue, 'store' => $stored, 'in_db' => $this->in_db[$cat][$key]]);
- }
-
if (($stored === $dbvalue) && $this->in_db[$cat][$key]) {
return true;
}
// manage array value
$value = (preg_match("|^a:[0-9]+:{.*}$|s", $pconfig['v']) ? unserialize($pconfig['v']) : $pconfig['v']);
- $this->in_db[$uid][$cat][$key] = true;
- return $value;
- } else {
-
- $this->in_db[$uid][$cat][$key] = false;
- return '!<unset>!';
+ if (isset($value) && $value !== '') {
+ $this->in_db[$uid][$cat][$key] = true;
+ return $value;
+ }
}
+
+ $this->in_db[$uid][$cat][$key] = false;
+ return '!<unset>!';
}
/**
// manage array value
$value = (preg_match("|^a:[0-9]+:{.*}$|s", $config['v']) ? unserialize($config['v']) : $config['v']);
- return $value;
- } else {
-
- return '!<unset>!';
+ if (isset($value) && $value !== '') {
+ return $value;
+ }
}
+
+ return '!<unset>!';
}
/**
// manage array value
$value = (preg_match("|^a:[0-9]+:{.*}$|s", $config['v']) ? unserialize($config['v']) : $config['v']);
- return $value;
- } else {
- return '!<unset>!';
+ if (isset($value) && $value !== '') {
+ return $value;
+ }
}
+ return '!<unset>!';
}
/**
namespace Friendica\Core\Config;
-use Friendica\Core\Logger;
-
/**
* This class is responsible for all system-wide configuration values in Friendica
* There are two types of storage
*/
public function set($cat, $key, $value)
{
- if ($key === 'last_worker_execution') {
- Logger::alert('catchmeifyou', ['value' => $value]);
- }
-
// set the cache first
$cached = $this->configCache->set($cat, $key, $value);
$age = (time() - self::$last_update) / 60;
self::$last_update = time();
- Logger::alert('last_update', ['age' => $age, 'last_update' => self::$last_update]);
-
if ($age > 1) {
$stamp = (float)microtime(true);
DBA::update('workerqueue', ['executed' => DateTimeFormat::utcNow()], ['pid' => $mypid, 'done' => false]);