Exemplo n.º 1
0
 /**
  * Returns the service container used for initialization of the repository.
  *
  * @return \eZ\Publish\Core\Base\ServiceContainer
  */
 protected function getServiceContainer()
 {
     if (!isset(self::$serviceContainer)) {
         $config = (include __DIR__ . '/../../../../../../config.php');
         $installDir = $config['install_dir'];
         /** @var \Symfony\Component\DependencyInjection\ContainerBuilder $containerBuilder */
         $containerBuilder = (include $config['container_builder_path']);
         /* @var \Symfony\Component\DependencyInjection\Loader\YamlFileLoader $loader */
         $loader->load('tests/integration_legacy.yml');
         $containerBuilder->setParameter('legacy_dsn', self::$dsn);
         $containerBuilder->setParameter('io_root_dir', self::$ioRootDir . '/' . $containerBuilder->getParameter('storage_dir'));
         self::$serviceContainer = new ServiceContainer($containerBuilder, $installDir, $config['cache_dir'], true, true);
     }
     return self::$serviceContainer;
 }
Exemplo n.º 2
0
 /**
  * Returns the service container used for initialization of the repository.
  *
  * @return \eZ\Publish\Core\Base\ServiceContainer
  */
 public function getServiceContainer()
 {
     if (!isset(self::$serviceContainer)) {
         $config = (include __DIR__ . '/../../../../../../config.php');
         $installDir = $config['install_dir'];
         /** @var \Symfony\Component\DependencyInjection\ContainerBuilder $containerBuilder */
         $containerBuilder = (include $config['container_builder_path']);
         /* @var \Symfony\Component\DependencyInjection\Loader\YamlFileLoader $loader */
         $loader->load('search_engines/legacy.yml');
         $loader->load('tests/integration_legacy.yml');
         $this->externalBuildContainer($containerBuilder);
         $containerBuilder->setParameter('legacy_dsn', self::$dsn);
         $containerBuilder->setParameter('io_root_dir', self::$ioRootDir . '/' . $containerBuilder->getParameter('storage_dir'));
         $containerBuilder->addCompilerPass(new Compiler\Search\SearchEngineSignalSlotPass('legacy'));
         $containerBuilder->addCompilerPass(new Compiler\Search\FieldRegistryPass());
         self::$serviceContainer = new ServiceContainer($containerBuilder, $installDir, $config['cache_dir'], true, true);
     }
     return self::$serviceContainer;
 }