mirror of
https://github.com/friendica/friendica
synced 2025-04-27 04:30:11 +00:00
Move adding Dice rules into App
This commit is contained in:
parent
19cd11cc8e
commit
856f8fb908
2 changed files with 14 additions and 8 deletions
14
src/App.php
14
src/App.php
|
@ -121,6 +121,8 @@ class App
|
|||
|
||||
public function processRequest(ServerRequestInterface $request, float $start_time): void
|
||||
{
|
||||
$this->setupContainerForRunningFrontend($request);
|
||||
|
||||
$this->requestId = $this->container->create(Request::class)->getRequestId();
|
||||
$this->auth = $this->container->create(Authentication::class);
|
||||
$this->config = $this->container->create(IManageConfigValues::class);
|
||||
|
@ -152,6 +154,18 @@ class App
|
|||
);
|
||||
}
|
||||
|
||||
private function setupContainerForRunningFrontend(ServerRequestInterface $request): void
|
||||
{
|
||||
/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
|
||||
$addonLoader = $this->container->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
|
||||
$this->container = $this->container->addRules($addonLoader->getActiveAddonConfig('dependencies'));
|
||||
$this->container = $this->container->addRule(\Friendica\App\Mode::class, ['call' => [['determineRunMode', [false, $request->getServerParams()], Dice::CHAIN_CALL]]]);
|
||||
|
||||
\Friendica\DI::init($this->container);
|
||||
|
||||
\Friendica\Core\Logger\Handler\ErrorHandler::register($this->container->create(\Psr\Log\LoggerInterface::class));
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the whole app instance
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue