mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-23 05:44:53 +00:00
Correctly load configuration
This commit is contained in:
parent
924543d78a
commit
a92bad1bc8
2 changed files with 4 additions and 9 deletions
|
@ -21,10 +21,8 @@ if (\PHP_SAPI=="cli") {
|
||||||
$cli->dispatch();
|
$cli->dispatch();
|
||||||
} else {
|
} else {
|
||||||
// load configuration
|
// load configuration
|
||||||
Arsse::load(new Conf());
|
$conf = file_exists(BASE."config.php") ? new Conf(BASE."config.php") : new Conf;
|
||||||
if (file_exists(BASE."config.php")) {
|
Arsse::load($conf);
|
||||||
Arsse::$conf->importFile(BASE."config.php");
|
|
||||||
}
|
|
||||||
// handle Web requests
|
// handle Web requests
|
||||||
$emitter = new \Zend\Diactoros\Response\SapiEmitter();
|
$emitter = new \Zend\Diactoros\Response\SapiEmitter();
|
||||||
$response = (new REST)->dispatch();
|
$response = (new REST)->dispatch();
|
||||||
|
|
|
@ -36,11 +36,8 @@ USAGE_TEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function loadConf(): bool {
|
protected function loadConf(): bool {
|
||||||
// FIXME: this should be a method of the Conf class
|
$conf = file_exists(BASE."config.php") ? new Conf(BASE."config.php") : new Conf;
|
||||||
Arsse::load(new Conf());
|
Arsse::load($conf);
|
||||||
if (file_exists(BASE."config.php")) {
|
|
||||||
Arsse::$conf->importFile(BASE."config.php");
|
|
||||||
}
|
|
||||||
// command-line operations will never respect authorization
|
// command-line operations will never respect authorization
|
||||||
Arsse::$user->authorizationEnabled(false);
|
Arsse::$user->authorizationEnabled(false);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue