[CORE][GNUSocial] Prevent multiple initializations
This commit is contained in:
parent
360a95c7aa
commit
9cf83db62a
|
@ -153,27 +153,31 @@ class GNUsocial implements EventSubscriberInterface
|
||||||
*/
|
*/
|
||||||
public function initialize(): void
|
public function initialize(): void
|
||||||
{
|
{
|
||||||
Common::setupConfig($this->config);
|
if (!$this->initialized) {
|
||||||
if (!\is_null($this->request)) {
|
Common::setupConfig($this->config);
|
||||||
Common::setRequest($this->request);
|
if (!\is_null($this->request)) {
|
||||||
|
Common::setRequest($this->request);
|
||||||
|
}
|
||||||
|
Log::setLogger($this->logger);
|
||||||
|
Event::setDispatcher($this->event_dispatcher);
|
||||||
|
I18n::setTranslator($this->translator);
|
||||||
|
DB::setManager($this->entity_manager);
|
||||||
|
Form::setFactory($this->form_factory);
|
||||||
|
Queue::setMessageBus($this->message_bus);
|
||||||
|
Security::setHelper($this->security);
|
||||||
|
HTML::setSanitizer($this->sanitizer);
|
||||||
|
Router::setRouter($this->router);
|
||||||
|
HTTPClient::setClient($this->client);
|
||||||
|
Formatting::setTwig($this->twig);
|
||||||
|
Cache::setupCache();
|
||||||
|
|
||||||
|
DB::initTableMap();
|
||||||
|
|
||||||
|
// Events are preloaded on compilation, but set at runtime, along with configuration
|
||||||
|
$this->module_manager->loadModules();
|
||||||
|
|
||||||
|
$this->initialized = true;
|
||||||
}
|
}
|
||||||
Log::setLogger($this->logger);
|
|
||||||
Event::setDispatcher($this->event_dispatcher);
|
|
||||||
I18n::setTranslator($this->translator);
|
|
||||||
DB::setManager($this->entity_manager);
|
|
||||||
Form::setFactory($this->form_factory);
|
|
||||||
Queue::setMessageBus($this->message_bus);
|
|
||||||
Security::setHelper($this->security);
|
|
||||||
HTML::setSanitizer($this->sanitizer);
|
|
||||||
Router::setRouter($this->router);
|
|
||||||
HTTPClient::setClient($this->client);
|
|
||||||
Formatting::setTwig($this->twig);
|
|
||||||
Cache::setupCache();
|
|
||||||
|
|
||||||
DB::initTableMap();
|
|
||||||
|
|
||||||
// Events are preloaded on compilation, but set at runtime, along with configuration
|
|
||||||
$this->module_manager->loadModules();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user