fix install-dir replacement in configfiles, thx to J-BBB

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2019-11-15 08:02:46 +01:00
parent a77f890462
commit b34e66dfd6
8 changed files with 23 additions and 19 deletions

View File

@@ -435,11 +435,7 @@ class ConfigDaemon
}
return '';
} elseif (preg_match('/^const\.(.*)$/', $matches[1], $match)) {
if (defined($match[1])) {
return constant($match[1]);
} else {
return '';
}
return $this->returnDynamic($match[1]);
} elseif (preg_match('/^sql\.(.*)$/', $matches[1], $match)) {
if (is_null($this->sqldata_cache)) {
// read in sql-data (if exists)
@@ -455,6 +451,14 @@ class ConfigDaemon
return $content;
}
private function returnDynamic($key = null)
{
$dynamics = [
'install_dir' => \Froxlor\Froxlor::getInstallDir()
];
return $dynamics[$key] ?? '';
}
/**
* Check if visibility should be changed
*