Commit b7523c24 authored by Tino Goratsch's avatar Tino Goratsch

minor improvements

parent 1da294ac
......@@ -89,9 +89,9 @@ class Bootstrap extends AbstractBootstrap
$this->dumpContainer($file);
require_once $file;
$this->container = new \ACP3ServiceContainer();
$this->appPath = $this->container->get('core.environment.application_path');
$this->container = new \ACP3ServiceContainer();
$this->container->set('core.environment.application_path', $this->appPath);
}
/**
......
......@@ -7,7 +7,6 @@ use ACP3\Core\Validation\DependencyInjection\RegisterValidationRulesPass;
use ACP3\Core\View\Renderer\Smarty\DependencyInjection\RegisterPluginsPass;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass;
......@@ -28,8 +27,7 @@ class ServiceContainerBuilder
{
$containerBuilder = new ContainerBuilder();
$containerBuilder->setDefinition('core.environment.application_path',
new Definition(ApplicationPath::class, [$appMode]));
$containerBuilder->set('core.environment.application_path', $appPath);
$containerBuilder->setParameter('core.environment', $appMode);
$containerBuilder->addCompilerPass(new RegisterListenersPass('core.eventDispatcher', 'core.eventListener',
......
......@@ -7,7 +7,6 @@ use ACP3\Installer\Core\Environment\ApplicationPath;
use ACP3\Installer\Core\FrontController;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
/**
......@@ -49,8 +48,8 @@ class Bootstrap extends Core\Application\AbstractBootstrap
public function initializeClasses()
{
$this->container = new ContainerBuilder();
$this->container->setDefinition('core.environment.application_path',
new Definition(ApplicationPath::class, [$this->appMode]));
$this->container->set('core.environment.application_path', $this->appPath);
$this->container->addCompilerPass(new Core\View\Renderer\Smarty\DependencyInjection\RegisterPluginsPass());
$loader = new YamlFileLoader($this->container, new FileLocator(__DIR__));
......@@ -76,8 +75,6 @@ class Bootstrap extends Core\Application\AbstractBootstrap
}
$this->container->compile();
$this->appPath = $this->container->get('core.environment.application_path');
}
private function applyThemePaths()
......
......@@ -145,16 +145,15 @@ class Install extends AbstractController
*/
private function _setContainer()
{
$environment = $this->container->getParameter('core.environment');
$this->container = new ContainerBuilder();
$this->container->set('core.environment.application_path', $this->appPath);
$this->container->setParameter('core.environment', $this->container->getParameter('core.environment'));
$loader = new YamlFileLoader($this->container, new FileLocator(__DIR__));
$loader->load($this->appPath->getClassesDir() . 'config/services.yml');
$loader->load($this->appPath->getInstallerClassesDir() . 'config/services.yml');
$this->container->setParameter('core.environment', $environment);
$modulesServices = glob($this->appPath->getModulesDir() . 'ACP3/*/Resources/config/services.yml');
foreach ($modulesServices as $moduleServices) {
$loader->load($moduleServices);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment