Bugfixings in Config

- replaced usage of "!<unset>!" with null-returns
- fixed bool settings (0/1)
- fixed overriding config-values
- fixed basepath problems
This commit is contained in:
Philipp Holzer 2019-02-22 23:51:13 +01:00
parent 2d91d5c3d9
commit 8c3aebc376
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
24 changed files with 175 additions and 157 deletions

View file

@ -205,6 +205,7 @@ class App
/**
* @brief App constructor.
*
* @param string $basePath The basedir of the app
* @param Configuration $config The Configuration
* @param LoggerInterface $logger The current app logger
* @param Profiler $profiler The profiler of this application
@ -212,14 +213,15 @@ class App
*
* @throws Exception if the Basepath is not usable
*/
public function __construct(Configuration $config, LoggerInterface $logger, Profiler $profiler, $isBackend = true)
public function __construct($basePath, Configuration $config, LoggerInterface $logger, Profiler $profiler, $isBackend = true)
{
BaseObject::setApp($this);
$this->logger = $logger;
$this->config = $config;
$this->profiler = $profiler;
$this->basePath = $this->config->get('system', 'basepath');
$cfgBasePath = $this->config->get('system', 'basepath');
$this->basePath = (isset($cfgBasePath) && $cfgBasePath !== '') ? $cfgBasePath : $basePath;
if (!Core\System::isDirectoryUsable($this->basePath, false)) {
throw new Exception('Basepath \'' . $this->basePath . '\' isn\'t usable.');