Inject Renderer to Initializer

[MAILPOET-1823]
This commit is contained in:
Rostislav Wolny
2019-02-20 14:06:39 +01:00
committed by M. Shull
parent d8503cf3c2
commit 171b3564f9
3 changed files with 34 additions and 13 deletions

View File

@@ -55,9 +55,10 @@ class ContainerConfigurator implements IContainerConfigurator {
$container->autowire(\MailPoet\Config\Hooks::class)->setPublic(true);
$container->autowire(\MailPoet\Config\Initializer::class)->setPublic(true);
$container->autowire(\MailPoet\Config\Menu::class)->setPublic(true);
$container->autowire(\MailPoet\Config\RendererFactory::class)->setPublic(true);
$container->register(\MailPoet\Config\Renderer::class)
->setPublic(true)
->setFactory([__CLASS__, 'createRenderer']);
->setFactory([new Reference(\MailPoet\Config\RendererFactory::class), 'getRenderer']);
// Cron
$container->autowire(\MailPoet\Cron\Daemon::class)->setPublic(true);
$container->autowire(\MailPoet\Cron\DaemonHttpRunner::class)->setPublic(true);
@@ -115,10 +116,4 @@ class ContainerConfigurator implements IContainerConfigurator {
}
return $container->get(IContainerConfigurator::PREMIUM_CONTAINER_SERVICE_SLUG)->get($id);
}
static function createRenderer() {
$caching = !WP_DEBUG;
$debugging = WP_DEBUG;
return new \MailPoet\Config\Renderer($caching, $debugging);
}
}