Will return the configured schema_tool service id,
or will define a default one lazy and return its id.

@param array $currentManagerConfig
@param ContainerBuilder $container
@return string
334936
private function getSchemaToolServiceIdForCurrentConfig(array $currentManagerConfig, ContainerBuilder $container)
    {
        // If there is a schema_tool configured, use it.
        if(!empty($currentManagerConfig['schema_tool'])) {
            return $currentManagerConfig['schema_tool'];
        }

        $serviceId = sprintf(
            'h4cc_alice_fixtures.orm.schema_tool.%s',
            $this->getCleanDoctrineConfigName($currentManagerConfig['doctrine'])
        );

        if (!$container->has($serviceId)) {
            $schemaToolDefinition = new Definition();
            $schemaToolDefinition->setClass($this->getSchemaToolClass($currentManagerConfig['doctrine']));
            $schemaToolDefinition->setArguments(array(
                new Reference($this->getCleanDoctrineConfigName($currentManagerConfig['doctrine']))
            ));
            $container->setDefinition($serviceId, $schemaToolDefinition);
        }

        return $serviceId;
    }
293944
public static function getInstance(AnConfigInterface $config, AnServiceInterface $container)
    {
        AnService::get('com:plugins.helper')->import('storage');

        if (!$container->has($config->service_identifier)) {
            $classname = $config->service_identifier->classname;
            $instance = new PlgStorageLocal($config);
            $container->set($config->service_identifier, $instance);
        }

        return $container->get($config->service_identifier);
    }
642197
private function findAndValidateMappingAwareDefinitionList(ContainerBuilder $container): array
    {
        $mappingAwareServiceDefinitionList = [];
        $methodAwareServiceIdList = array_keys($container->findTaggedServiceIds(self::JSONRPC_METHOD_AWARE_TAG));
        foreach ($methodAwareServiceIdList as $serviceId) {
            $definition = $container->getDefinition($serviceId);

            $this->checkMethodAwareServiceIdList($definition, $serviceId, $container);

            $mappingAwareServiceDefinitionList[$serviceId] = $definition;
        }

        return $mappingAwareServiceDefinitionList;
    }
502364
protected function getRootProviderName(ContainerInterface $container)
    {
        $rootProvider = $container->getBasicDefinition()->getRootDataProvider();

        if (!$rootProvider) {
            throw new DcGeneralRuntimeException(
                'Root data provider name not specified in DCA but rootEntries section specified.'
            );
        }

        if (!$container->getDataProviderDefinition()->hasInformation($rootProvider)) {
            throw new DcGeneralRuntimeException('Unknown root data provider but rootEntries section specified.');
        }

        return $rootProvider;
    }
22738
private function loadBundleServiceDefinitions(ContainerBuilder $container)
    {
        $fileLocator = new FileLocator(self::SERVICES_CONFIG_DIRECTORY_RELATIVE_PATH);

        $loader = new XmlFileLoader($container, $fileLocator);

        $loader->load('services.xml');
    }
168374
protected function getPluginManagerServices() {
    $container_builder = $this->containerBuilderGetter->getContainerBuilder();

    // Get the definitions of services from the container.
    $definitions = $container_builder->getDefinitions();

    // Filter them down to the ones that are plugin managers.
    $plugin_manager_service_ids = [];
    foreach ($definitions as $service_id => $definition) {
      // Skip any deprecated service.
      if ($definition->isDeprecated()) {
        continue;
      }

      // Assume that any service whose name is of the form plugin.manager.FOO
      // is a plugin type manager.
      if (strpos($service_id, 'plugin.manager.') === 0) {
        $plugin_manager_service_ids[] = $service_id;

        continue;
      }

      // Skip the entity type manager: these don't behave at all like normal
      // plugins.
      if ($service_id == 'entity_type.manager') {
        continue;
      }

      // Find any plugin managers which don't conform to the pattern for the
      // service name, but do inherit from the DefaultPluginManager class.
      $service_class = $definition->getClass();
      if (is_subclass_of($service_class, \Drupal\Core\Plugin\DefaultPluginManager::class)) {
        $plugin_manager_service_ids[] = $service_id;
      }
    }

    // Filter out a blacklist of known broken plugin types.
    $plugin_manager_service_ids = array_diff($plugin_manager_service_ids, [
      // https://www.drupal.org/project/ctools/issues/2938586
      'plugin.manager.ctools.relationship',
    ]);

    //drush_print_r($plugin_manager_service_ids);

    // Developer trapdoor: just process the block plugin type, to make terminal
    // debug output easier to read through.
    //$plugin_manager_service_ids = array('plugin.manager.block');

    return $plugin_manager_service_ids;
  }
853753
protected function getSchemaManager()
    {
        if ($this->schemaManager == null) {
            common_Logger::d('init dbal connection to get SchemaMangager');
            $config = new \Doctrine\DBAL\Configuration();
            $params = $this->getDriver()->getParams();
            $connection = \Doctrine\DBAL\DriverManager::getConnection($params, $config);
            $this->schemaManager = $connection->getSchemaManager();
        }
        return $this->schemaManager;
    }
205262
protected function process(array $config, ContainerBuilder $container)
    {
        $container->setParameter('qcm_core.website_name', $config['website_name']);
        $container->setParameter('qcm.model.user.class', $config['user_class']);
        $container->setParameter('qcm.configuration', $config['configuration']);
        $container->setParameter('qcm_core.statistics.class', $config['service']['statistics']['class']);
        $container->setParameter('qcm_core.template.class', $config['service']['statistics']['template']);

        $container->setAlias('qcm.configuration', $config['service']['configuration']);
        $container->setAlias('qcm.user_session_configuration', $config['service']['user_session_configuration']);

        return $config;
    }
406944
protected function getContainerBuilder()
    {
        if ($this->containerBuilder) {
            return $this->containerBuilder;
        }

        $kernel = $this->getApplication()->getKernel();

        if (!$kernel->isDebug() || !(new ConfigCache($kernel->getContainer()->getParameter('debug.container.dump'), true))->isFresh()) {
            $buildContainer = \Closure::bind(function () { return $this->buildContainer(); }, $kernel, \get_class($kernel));
            $container = $buildContainer();
        } else {
            (new XmlFileLoader($container = new ContainerBuilder(), new FileLocator()))->load($kernel->getContainer()->getParameter('debug.container.dump'));
            $container->setParameter('container.build_hash', $hash = ContainerBuilder::hash(__METHOD__));
            $container->setParameter('container.build_id', hash('crc32', $hash.time()));
        }

        $container->getCompilerPassConfig()->setRemovingPasses([]);
        $container->compile();

        return $this->containerBuilder = $container;
    }
1211763
public function newServicesManager( ContainerBuilder $containerBuilder = null ) {

		if ( $containerBuilder === null ) {
			$containerBuilder = $this->newCallbackContainerBuilder();
		}

		return new ServicesManager( $containerBuilder );
	}
696854
protected function registerElfinderServices(Container $container)
    {
        /**
         * Configure the "config.admin.elfinder" dataset.
         *
         * @param  AdminConfig $adminConfig The admin configset.
         * @return AdminConfig
         */
        $container->extend('admin/config', function (AdminConfig $adminConfig) {
            $adminConfig['elfinder'] = new Config($adminConfig['elfinder']);

            return $adminConfig;
        });

        /**
         * The elFinder configset.
         *
         * @param  Container $container The Pimple DI Container.
         * @return ConfigInterface
         */
        $container['elfinder/config'] = function (Container $container) {
            return $container['admin/config']['elfinder'];
        };
    }
1259079
private function getDefinitionsAsContainer(ContainerBuilder $container, ServiceConfig $serviceConfig)
    {
        $tag = $serviceConfig->get(ServiceConfig::FIND_TAG);

        if (!$container->hasDefinition($serviceId = $tag.'.service_container')) {
            $definition = $this->createContainerDefinition($container, $serviceConfig);
            $definition->setPublic(true);

            $container->setDefinition($serviceId, $definition);

        } else {
            $definition = $container->getDefinition($serviceId);
        }

        return $definition;
    }
1042379
public static ServiceManagerProvider current()
  {
    ServiceManagerProvider systemProvider = _systemProvider;
    
    if (systemProvider != null) {
      return systemProvider;
    }
    
    Thread thread = Thread.currentThread();
    ClassLoader loader = thread.getContextClassLoader();
    
    return getProvider(loader);
  }
310279
protected function createIdGenerator(Container $container, array $config)
    {
        $className = array_pull($config, 'class', IdGenerator::class);

        return $container->make($className);
    }
53523
protected function getManagedClass(Definition $admin, ContainerBuilder $container)
    {
        return $container->getParameterBag()->resolveValue($admin->getArgument(1));
    }
13920
public function load(array $configs, ContainerBuilder $container)
    {
        $configs[] = $this->options;
        $configuration = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($configuration, $configs);

        $container->register('doctrine.orm.metadata_driver', 'Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain');

        foreach ($config['mapping'] as $name => $mappingConfig) {
            $mappingConfig['name'] = $name;
            $this->configureMappingDriver($mappingConfig, $container);
        }

        $container->register('doctrine.orm.configuration', 'Doctrine\ORM\Configuration')
            ->addMethodCall('setMetadataDriverImpl', array(new Reference('doctrine.orm.metadata_driver')))
            ->addMethodCall('setProxyNamespace', array('Proxy'));

        if ($container->hasParameter('app.cache') && $container->getParameter('app.cache') === true) {
            $container->getDefinition('doctrine.orm.configuration')
                ->addMethodCall('setProxyDir', array('%app.cache_dir%/doctrine'));
        } else {
            $container->getDefinition('doctrine.orm.configuration')
                ->addMethodCall('setProxyDir', array(sys_get_temp_dir().'/doctrine'))
                ->addMethodCall('setAutoGenerateProxyClasses', array(AbstractProxyFactory::AUTOGENERATE_EVAL));

        }

        $container->register('doctrine.orm.entity_manager', 'Doctrine\ORM\EntityManager')
            ->setFactoryClass('Doctrine\ORM\EntityManager')
            ->setFactoryMethod('create')
            ->addArgument($config['database'])
            ->addArgument(new Reference('doctrine.orm.configuration'));

        $container->setAlias('doctrine.dbal.configuration', new Alias('doctrine.orm.configuration'));

        $container->register('doctrine.dbal.database_connection', 'Doctrine\DBAL\Connection')
            ->setFactoryService('doctrine.orm.entity_manager')
            ->setFactoryMethod('getConnection');
    }
1109205
public function getRendererManager(Container $container)
    {
        if ($this->rendererManager) {
            return $this->rendererManager;
        }

        return $container->get(RendererManager::class);
    }