chore: Use Application helper class and externalize UpgradeConfigChecker.

Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
Rubén D
2022-05-16 22:04:08 +02:00
parent 98ffc311cf
commit f22145b389
16 changed files with 198 additions and 128 deletions

View File

@@ -29,6 +29,7 @@ use Psr\Container\ContainerInterface;
use SP\Config\Config;
use SP\Core\Acl\Acl;
use SP\Core\Acl\UnauthorizedPageException;
use SP\Core\Application;
use SP\Core\Bootstrap\BootstrapBase;
use SP\Core\Context\ContextInterface;
use SP\Core\Events\EventDispatcher;
@@ -65,9 +66,7 @@ abstract class SimpleControllerBase
* @throws \JsonException
*/
public function __construct(
EventDispatcher $eventDispatcher,
Config $config,
ContextInterface $session,
Application $application,
ThemeInterface $theme,
Klein $router,
Acl $acl,
@@ -78,10 +77,10 @@ abstract class SimpleControllerBase
$this->dic = BootstrapBase::getContainer();
$this->controllerName = $this->getControllerName();
$this->configData = $config->getConfigData();
$this->eventDispatcher = $eventDispatcher;
$this->config = $config;
$this->session = $session;
$this->config = $application->getConfig();
$this->configData = $this->config->getConfigData();
$this->eventDispatcher = $application->getEventDispatcher();
$this->session = $application->getContext();
$this->theme = $theme;
$this->router = $router;
$this->acl = $acl;
@@ -106,8 +105,6 @@ abstract class SimpleControllerBase
}
}
abstract protected function initialize(): void;
/**
* Comprobaciones
*