diff --git a/src/App.php b/src/App.php index f41d486b5..f48abcf9c 100644 --- a/src/App.php +++ b/src/App.php @@ -219,7 +219,7 @@ class App $this->logger = $logger; $this->config = $config; $this->profiler = $profiler; - $this->basePath = $this->config->getCache()->get('system', 'basepath'); + $this->basePath = $this->config->get('system', 'basepath'); if (!Core\System::isDirectoryUsable($this->basePath, false)) { throw new Exception('Basepath \'' . $this->basePath . '\' isn\'t usable.'); diff --git a/src/Core/Config/Adapter/JITConfigAdapter.php b/src/Core/Config/Adapter/JITConfigAdapter.php index 95211777f..5d06dc2b3 100644 --- a/src/Core/Config/Adapter/JITConfigAdapter.php +++ b/src/Core/Config/Adapter/JITConfigAdapter.php @@ -57,13 +57,14 @@ class JITConfigAdapter extends AbstractDbaConfigAdapter implements IConfigAdapte // manage array value $value = (preg_match("|^a:[0-9]+:{.*}$|s", $config['v']) ? unserialize($config['v']) : $config['v']); - $this->in_db[$cat][$key] = true; - return $value; - } else { - - $this->in_db[$cat][$key] = false; - return '!!'; + if (isset($value) && $value !== '') { + $this->in_db[$cat][$key] = true; + return $value; + } } + + $this->in_db[$cat][$key] = false; + return '!!'; } /** diff --git a/src/Core/Config/Adapter/JITPConfigAdapter.php b/src/Core/Config/Adapter/JITPConfigAdapter.php index c5f3a381e..d3c38623b 100644 --- a/src/Core/Config/Adapter/JITPConfigAdapter.php +++ b/src/Core/Config/Adapter/JITPConfigAdapter.php @@ -57,13 +57,14 @@ class JITPConfigAdapter extends AbstractDbaConfigAdapter implements IPConfigAdap // 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 '!!'; + if (isset($value) && $value !== '') { + $this->in_db[$uid][$cat][$key] = true; + return $value; + } } + + $this->in_db[$uid][$cat][$key] = false; + return '!!'; } /** diff --git a/src/Core/Config/Adapter/PreloadConfigAdapter.php b/src/Core/Config/Adapter/PreloadConfigAdapter.php index fa691a16d..b1866a259 100644 --- a/src/Core/Config/Adapter/PreloadConfigAdapter.php +++ b/src/Core/Config/Adapter/PreloadConfigAdapter.php @@ -55,11 +55,12 @@ class PreloadConfigAdapter extends AbstractDbaConfigAdapter implements IConfigAd // manage array value $value = (preg_match("|^a:[0-9]+:{.*}$|s", $config['v']) ? unserialize($config['v']) : $config['v']); - return $value; - } else { - - return '!!'; + if (isset($value) && $value !== '') { + return $value; + } } + + return '!!'; } /** diff --git a/src/Core/Config/Adapter/PreloadPConfigAdapter.php b/src/Core/Config/Adapter/PreloadPConfigAdapter.php index e79a4a1e3..857f2b176 100644 --- a/src/Core/Config/Adapter/PreloadPConfigAdapter.php +++ b/src/Core/Config/Adapter/PreloadPConfigAdapter.php @@ -71,10 +71,11 @@ class PreloadPConfigAdapter extends AbstractDbaConfigAdapter implements IPConfig // manage array value $value = (preg_match("|^a:[0-9]+:{.*}$|s", $config['v']) ? unserialize($config['v']) : $config['v']); - return $value; - } else { - return '!!'; + if (isset($value) && $value !== '') { + return $value; + } } + return '!!'; } /** diff --git a/src/Core/Worker.php b/src/Core/Worker.php index dff60e9fa..4007a7923 100644 --- a/src/Core/Worker.php +++ b/src/Core/Worker.php @@ -439,7 +439,7 @@ class Worker Logger::log("Process ".$mypid." - Prio ".$queue["priority"]." - ID ".$queue["id"].": ".$funcname." - done in ".number_format($duration, 4)." seconds. Process PID: ".$new_process_id); - $a->getProfiler()->saveLog("ID " . $queue["id"] . ": " . $funcname); + $a->getProfiler()->saveLog($a->getLogger(), "ID " . $queue["id"] . ": " . $funcname); $cooldown = Config::get("system", "worker_cooldown", 0);