chore: Refactoring of Bootstrap class into an abstract class.

This allows to implement bootstrap classes for each module and simplifies the bootstrap code.

Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
Rubén D
2022-05-16 19:01:28 +02:00
parent fe349cb6f9
commit 98ffc311cf
32 changed files with 1024 additions and 844 deletions

View File

@@ -25,7 +25,7 @@
namespace SP\Core;
use Klein\Klein;
use SP\Bootstrap;
use SP\Core\Bootstrap\BootstrapBase;
use SP\Http\Request;
use SP\Util\Util;
@@ -58,13 +58,13 @@ abstract class HttpModuleBase extends ModuleBase
protected function checkMaintenanceMode(): bool
{
if ($this->configData->isMaintenance()) {
Bootstrap::$LOCK = Util::getAppLock();
BootstrapBase::$LOCK = Util::getAppLock();
return !$this->request->isAjax()
|| !(Bootstrap::$LOCK !== false
&& Bootstrap::$LOCK->userId > 0
|| !(BootstrapBase::$LOCK !== false
&& BootstrapBase::$LOCK->userId > 0
&& $this->context->isLoggedIn()
&& Bootstrap::$LOCK->userId === $this->context->getUserData()->getId());
&& BootstrapBase::$LOCK->userId === $this->context->getUserData()->getId());
}
return false;