Configure and create a container using all configuration files found in included modules.
540670
public function createContainer() : Container
    {
        $containerBuilder = new ContainerBuilder();

        foreach ($this->modules as $module) {
            $this->loadModule($containerBuilder, $module);
        }

        if (!empty($this->config)) {
            $containerBuilder->addDefinitions($this->config);
        }

        $this->configureContainerBuilder($containerBuilder);

        return $containerBuilder->build();
    }
656648
public static function initKernel()
    {
        $configFiles = self::getConfigFiles();

        $fs = new Filesystem();

        if(!$fs->exists($configFiles['bundles'])){
            $fs->copy($configFiles['bundles_dist'], $configFiles['bundles'], true);
        }
        if(!$fs->exists($configFiles['config'])){
            $fs->copy($configFiles['config_dist'], $configFiles['config'], true);
        }
        if(!$fs->exists($configFiles['routing'])){
            $fs->copy($configFiles['routing_dist'], $configFiles['routing'], true);
        }
        if(!$fs->exists($configFiles['security'])){
            $fs->copy($configFiles['security_dist'], $configFiles['security'], true);
        }
    }
1145312
def include_config(*files)
      include_base = File.dirname(@config_file) if @config_file
      files.each do |file|
        path = File.join(include_base, file) if include_base
        include_file(path || file)
      end
    end
1197333
def init(config):
    
    from pkg_resources import resource_stream
    import shutil

    config_file = Path(config.config_file)
    if config_file.is_file():
        click.echo('{} already exists, maybe you want $ sedge update'.format(config_file))
        sys.exit()

    config_file.parent.mkdir(parents=True, exist_ok=True)
    with resource_stream(__name__, 'sedge_template.conf') as src_stream:
        with open(config.config_file, 'wb') as target_stream:
            shutil.copyfileobj(src_stream, target_stream)
333849
private function createContainer(): void
    {
        if (!$this->container) {
            $builder = new ContainerBuilder();
            $builder->addDefinitions([
                self::class => $this,
            ]);
            $this->container = $builder->build();
        }
    }
1141421
def _setup(module, extras):
    """"""

    Qt.__binding__ = module.__name__

    for name in list(_common_members) + extras:
        try:
            submodule = _import_sub_module(
                module, name)
        except ImportError:
            try:
                # For extra modules like sip and shiboken that may not be
                # children of the binding.
                submodule = __import__(name)
            except ImportError:
                continue

        setattr(Qt, "_" + name, submodule)

        if name not in extras:
            # Store reference to original binding,
            # but don't store speciality modules
            # such as uic or QtUiTools
            setattr(Qt, name, _new_module(name))
1022076
def _setup(self):
        
        role_directory = os.path.join(self._config.scenario.directory,
                                      self.options['roles-path'])
        if not os.path.isdir(role_directory):
            os.makedirs(role_directory)
892593
def create(self, remove_all_rc_files=False):
        
        # Check and create configuration directory
        if os.path.exists(self.config_dir):
            self.LOG.debug("Configuration directory %r already exists!" % (self.config_dir,))
        else:
            os.mkdir(self.config_dir)

        if remove_all_rc_files:
            for subdir in ('.', 'rtorrent.d'):
                config_files = list(glob.glob(os.path.join(os.path.abspath(self.config_dir), subdir, '*.rc')))
                config_files += list(glob.glob(os.path.join(os.path.abspath(self.config_dir), subdir, '*.rc.default')))
                for config_file in config_files:
                    self.LOG.info("Removing %r!" % (config_file,))
                    os.remove(config_file)

        # Create default configuration files
        for filepath in sorted(walk_resources("pyrocore", "data/config")):
            # Load from package data
            text = pymagic.resource_string("pyrocore", "data/config" + filepath)

            # Create missing subdirs
            config_file = self.config_dir + filepath
            if not os.path.exists(os.path.dirname(config_file)):
                os.makedirs(os.path.dirname(config_file))

            # Write configuration files
            config_trail = [".default"]
            if os.path.exists(config_file):
                self.LOG.debug("Configuration file %r already exists!" % (config_file,))
            else:
                config_trail.append('')
            for i in config_trail:
                with open(config_file + i, "w") as handle:
                    handle.write(text)
                self.LOG.info("Configuration file %r written!" % (config_file + i,))
877495
protected function initializeContainer()
    {
        $this->container = new ContainerBuilder();

        $this->container->addCompilerPass(new DependencyInjection\EnvironmentCompilerPass());
        $this->container->addCompilerPass(new DependencyInjection\TypeCompilerPass());
        $this->container->addCompilerPass(new DependencyInjection\ThemeCompilerPass());
        $this->container->addCompilerPass(new DependencyInjection\FormatCompilerPass());
        $this->container->addCompilerPass(new DependencyInjection\RendererCompilerPass());
        $this->container->addCompilerPass(new DependencyInjection\InspectorCompilerPass());
        $this->container->addCompilerPass(new DependencyInjection\MetadataCompilerPass());

        $this->container->setParameter('root_dir', __DIR__);
        $this->container->setParameter('helpers', array(
            'Ladybug\Dumper:dump'
        ));
    }
778153
def create(name, config_file=None, template=None, backing_store=None, template_options=None):
    '''
    
    
    '''
    if exists(name):
        raise ContainerAlreadyExists("The Container %s is already created!" % name)
    cmd = 'lxc-create -n %s' % name

    if config_file:
        cmd += ' -f %s' % config_file
    if template:
        cmd += ' -t %s' % template
    if backing_store:
        cmd += ' -B %s' % backing_store
    if template_options:
        cmd += '-- %s' % template_options

    if subprocess.check_call('%s >> /dev/null' % cmd, shell=True) == 0:
        if not exists(name):
            _logger.critical("The Container %s doesn't seem to be created! (options: %s)", name, cmd[3:])
            raise ContainerNotExists("The container (%s) does not exist!" % name)

        _logger.info("Container %s has been created with options %s", name, cmd[3:])
        return 0
    else:
        return 1
1229599
public function loadConfig()
    {
        parent::loadConfig();
        foreach(Config::get('@' . $this->moduleName . '.configs', []) as $name => $fileName)
        {
            Config::addConfig($name, include $fileName);
        }
    }
269486
def _configure_manager(self):
        
        self._manager = ContainerManager(self, resource_class=Container,
                response_key="", uri_base="")
1282108
public function build()
    {
        foreach ($this->modules->enabled() as $module) {
            $name = studly_case($module->getName());
            $class = 'Modules\\'.$name.'\\MenuExtenders\\SidebarExtender';

            if (class_exists($class)) {
                $extender = $this->container->make($class);

                $this->menu->add(
                    $extender->extendWith($this->menu)
                );
            }
        }
    }
625453
public static function configureAsRoot(): void
    {
        $filesystem = new Filesystem();
        $vendor_dir = Path::VENDOR_DIR . '/hostnet/phpcs-tool/src';
        if ($filesystem->exists($vendor_dir)) {
            return;
        }

        self::configure();

        $filesystem->mkdir($vendor_dir . '/Hostnet');
        $filesystem->symlink(__DIR__ . '/../../Sniffs', $vendor_dir . '/Hostnet/Sniffs');
        $filesystem->copy(__DIR__ . '/../../ruleset.xml', $vendor_dir . '/Hostnet/ruleset.xml');

        $filesystem->mkdir($vendor_dir . '/HostnetPaths');
        $filesystem->copy(__DIR__ . '/../../../HostnetPaths/ruleset.xml', $vendor_dir . '/HostnetPaths/ruleset.xml');
    }
611388
protected function initialize(): void
	{
		// Create container instance and register it in itself so that it can be injected

		$this->container = $this->containerFactory();

		$this->container->registerInstance([Container::class, 'container'], $this->container);

		// Register self so that the application instance can be injected

		$this->container->registerInstance([Application::class, 'app'], $this);

		// Register file system instance

		$this->container->registerInstance([FileSystem::class, 'fileSystem'], new FileSystem);

		// Register config instance

		$this->config = $this->configFactory();

		$this->container->registerInstance([Config::class, 'config'], $this->config);
	}
584396
def configure(self, ext):
        """"""
        ext.include_dirs += self.include_dirs
        ext.library_dirs += self.library_dirs
        ext.libraries += self.libraries
        ext.extra_compile_args += self.extra_compile_args
        ext.extra_link_args += self.extra_link_args
        ext.extra_objects += self.extra_objects
723337
protected function buildContainer()
    {
        // Get MicroCMS container builder
        $builder = new ContainerBuilder($this->getContainerBuilder());

        // Set file loader for config files
        $config_dirs = array($this->getSystemConfigDir(), $this->getConfigDir());
        $config_locator = new FileLocator($config_dirs);
        $builder->setConfigLocator($config_locator);

        // Finish container
        $container = $builder->prepareContainer();
        $container->set('kernel', $this);
        $container->set('kernel.config_locator', $config_locator);
        $container->compile();

        return($container);
    }