예제 #1
0
 private function setUpContainer()
 {
     $this->set('core.http.symfony_request', $this->symfonyRequest);
     $this->set('core.environment.application_path', $this->applicationPath);
     $this->setParameter('core.environment', $this->applicationMode);
     $this->addCompilerPass(new RegisterListenersPass('core.event_dispatcher', 'core.eventListener', 'core.eventSubscriber'));
     $this->addCompilerPass(new RegisterSmartyPluginsPass());
     $this->addCompilerPass(new RegisterColumnRendererPass());
     $this->addCompilerPass(new RegisterValidationRulesPass());
     $this->addCompilerPass(new RegisterWysiwygEditorsCompilerPass());
     $this->addCompilerPass(new RegisterColumnTypesCompilerPass());
     $loader = new YamlFileLoader($this, new FileLocator(__DIR__));
     $loader->load($this->applicationPath->getClassesDir() . 'config/services.yml');
     $loader->load($this->applicationPath->getClassesDir() . 'View/Renderer/Smarty/config/services.yml');
     // Try to get all available services
     /** @var Modules $modules */
     $modules = $this->get('core.modules');
     $availableModules = $this->allModules === true ? $modules->getAllModules() : $modules->getActiveModules();
     $vendors = $this->get('core.modules.vendors')->getVendors();
     foreach ($availableModules as $module) {
         foreach ($vendors as $vendor) {
             $modulePath = $this->applicationPath->getModulesDir() . $vendor . '/' . $module['dir'];
             $path = $modulePath . '/Resources/config/services.yml';
             if (is_file($path)) {
                 $loader->load($path);
             }
             $this->registerCompilerPass($vendor, $module['dir']);
         }
     }
     $this->compile();
 }