Registers metadata extensions.

@see    \Charcoal\Model\ServiceProvider\ModelServiceProvider
@param  Container $container The Pimple DI container.
@return void
484674
protected function registerMetadataExtensions(Container $container)
    {
        if (!isset($container['metadata/config'])) {
            /**
             * @return MetadataConfig
             */
            $container['metadata/config'] = function () {
                return new MetadataConfig();
            };
        }

        /**
         * Alters the application's metadata configset.
         *
         * This extension will duplicate each previously defined
         * metadata include path to introduce an "admin" subdirectory
         * which adds support for Admin-only metadata settings.
         *
         * For example, if a developer defines the following paths:
         *
         * ```json
         * "paths": [
         *     "my-app/metadata/",
         *     "vendor/locomotivemtl/charcoal-cms/metadata/"
         * ]
         * ```
         *
         * The Admin's service provider will duplicate like so:
         *
         * ```json
         * "paths": [
         *     "my-app/metadata/admin/",
         *     "my-app/metadata/",
         *     "vendor/locomotivemtl/charcoal-cms/metadata/admin/"
         *     "vendor/locomotivemtl/charcoal-cms/metadata/"
         * ]
         * ```
         *
         * Any data included from the "admin" subdirectory will override
         * any "base" data that's been imported.
         *
         * @param  MetadataConfig $metaConfig The metadata configset.
         * @param  Container      $container  The Pimple DI container.
         * @return MetadataConfig
         */
        $container->extend('metadata/config', function (MetadataConfig $metaConfig, Container $container) {
            $adminConfig = $container['admin/config'];
            $adminDir    = '/'.trim($adminConfig['base_path'], '/');

            $metaPaths   = $metaConfig->paths();
            $parsedPaths = [];
            foreach ($metaPaths as $basePath) {
                $adminPath = rtrim($basePath, '/').$adminDir;

                array_push($parsedPaths, $adminPath, $basePath);
            }

            $metaConfig->setPaths($parsedPaths);

            return $metaConfig;
        });
    }
925204
public function register(Container $container)
    {
        $router = new RouteCollection(config()->get('namespace', '\\Controller\\'));
        $dispatcher = new RouteDispatcher($router, $container['config']->get('middleware', []));

        $container->add('router', $router);
        $container->add('dispatcher', $dispatcher);

        include app()->getPath().'/config/routes.php';
    }
938104
public function register(Container $container)
    {
        $this->registerFinder($container);
        $this->registerSections($container);
        $this->registerTemplate($container);
        $this->registerEngine($container);
    }
484427
public function register(Container $container)
    {
        $closure = function (Container $container) {
            $manager = $container->newInstance(LoggerManager::class, [
                'logPath' => $container->get('config')->get('path.logs')
            ]);

            return $manager;
        };

        $container->share(LoggerManager::class, $closure);
    }
840055
private function registerService(ContainerBuilder $container, $serviceId, $serviceClass)
    {
        if (class_exists($serviceClass)) {
            $container->register($serviceId, $serviceClass);
        }
    }
806052
public function register(Container $container)
    {
        $container->prepareSharedObject(
            EventDispatcher::class,
            function (EventDispatcher $dispatcher, Container $container) {
                $dispatcher->foo = 'bar';

                return $dispatcher->setDebug($container->get('config')->get('system.debug'));
            }
        )->bindShared(Dispatcher::class, EventDispatcher::class)
            ->bindShared(DispatcherInterface::class, EventDispatcher::class);
    }
761843
public function register(Container $container)
    {
        $container->share(MatcherInterface::class, [$this, 'matcher']);

        $container->prepareSharedObject(RouteCreator::class);
        $container->prepareSharedObject(MainRouter::class);
    }
171023
public function register(Container $pimple)
    {
        $pimple["$this->prefix.config"] = $this->defineDefaultConfig();
        $pimple["$this->prefix.command_bus"] = $this->setUpCommandBus($pimple);
        $pimple["$this->prefix.event_bus"] = $this->setUpEventBus();
        $pimple["$this->prefix.event_store"] = $this->setUpEventStore($pimple);
        $pimple["$this->prefix.snapshot_store"] = $this->setUpSnapshotStore($pimple);
        $pimple["$this->prefix.snapshotter"] = $this->setUpSnapshotter($pimple);
        $pimple["$this->prefix.repository.aggregate"] = $this->setUpAggregateRepository();
        $pimple["$this->prefix.serializer"] = $this->setUpSerializer($pimple);
    }
1141418
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition(TabRegistry::class)) {
            return;
        }

        $tabRegistry = $container->getDefinition(TabRegistry::class);
        $tabGroupDefinition = new Definition(TabGroup::class, ['systeminfo']);
        $tabRegistry->addMethodCall('addTabGroup', [$tabGroupDefinition]);
    }
82267
public function process(ContainerBuilder $container)
    {
        $this->registerStateExtractors($container);
        $this->registerStateElements($container);
        $this->registerResultModifications($container);
    }
75586
protected function registerFactoryServices(Container $container)
    {
        /**
         * @param  Container $container The Pimple DI container.
         * @return FactoryInterface
         */
        $container['property/input/factory'] = function (Container $container) {
            return new Factory([
                'base_class'       => PropertyInputInterface::class,
                'arguments'        => [[
                    'container' => $container,
                    'logger'    => $container['logger']
                ]],
                'resolver_options' => [
                    'suffix' => 'Input'
                ]
            ]);
        };

        /**
         * @param  Container $container The Pimple DI container.
         * @return FactoryInterface
         */
        $container['property/display/factory'] = function (Container $container) {
            return new Factory([
                'base_class'       => PropertyDisplayInterface::class,
                'arguments'        => [[
                    'container' => $container,
                    'logger'    => $container['logger']
                ]],
                'resolver_options' => [
                    'suffix' => 'Display'
                ]
            ]);
        };

        /**
         * @param  Container $container A Pimple DI container.
         * @return FactoryInterface
         */
        $container['secondary-menu/group/factory'] = function (Container $container) {
            return new Factory([
                'base_class'       => SecondaryMenuGroupInterface::class,
                'default_class'    => GenericSecondaryMenuGroup::class,
                'arguments'        => [[
                    'container'      => $container,
                    'logger'         => $container['logger'],
                    'view'           => $container['view'],
                    'layout_builder' => $container['layout/builder']
                ]],
                'resolver_options' => [
                    'suffix' => 'SecondaryMenuGroup'
                ]
            ]);
        };
    }
461173
public function process(ContainerBuilder $container)
    {
        if (!$container->has($this->getCollectorServiceName())) {
            return;
        }

        $definition = $container->findDefinition(
            $this->getCollectorServiceName()
        );

        $taggedServices = $this->findAndSortTaggedServices(
            $this->getTagName(),
            $container
        );

        /*
         * Per each service, add a new method call reference
         */
        foreach ($taggedServices as $service) {
            $definition->addMethodCall(
                $this->getCollectorMethodName(),
                [$service]
            );
        }
    }
37192
public function register(Container $container)
    {
        $container->prepareSharedObject(AssetManager::class);
        $container->prepareSharedObject(ScriptManager::class);

        AbstractScript::$instance = function () use ($container) {
            return $container->get(ScriptManager::class);
        };
    }
412134
protected function registerSelectizeServices(Container $container)
    {
        /**
         * The Selectize Renderer.
         *
         * @param  Container $container The Pimple DI container.
         * @return SelectizeRenderer
         */
        $container['selectize/renderer'] = function (Container $container) {
            return new SelectizeRenderer([
                'logger'           => $container['logger'],
                'translator'       => $container['translator'],
                'template_factory' => $container['template/factory'],
                'view'             => $container['view']
            ]);
        };
    }
1019886
public function process(ContainerBuilder $container){
		if (!$container->hasDefinition(ParserChainInterface::SERVICE_ID)) {
			return;
		}
		
		$definition = $container->getDefinition(ParserChainInterface::SERVICE_ID);

		$taggedServices = $container->findTaggedServiceIds(MediaParserInterface::SERVICE_TAG);
		
		foreach ($taggedServices as $id => $tagAttributes) {
			foreach ($tagAttributes as $attributes) {
				$definition->addMethodCall(
						'addParser',
						array(new Reference($id))
				);
			}
		}
	}
787499
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition('profiler') || !$container->hasDefinition('twig')) {
            return;
        }

        $container->register('contentful.delivery.profiler_controller', ProfilerController::class)
            ->setArguments([
                new Reference('profiler'),
                new Reference('twig'),
            ])
            ->setPublic(\true)
            ->addTag('controller.service_arguments')
        ;
    }
1073975
public function register(Container $container)
    {
        $container['extensions.sections'] = function ($c) {
            return new Sections($c['section.factory'], $c['events']);
        };

        $container['extensions.helpers'] = function ($c) {
            return new Helpers($c['escaper'], $c['options']);
        };

        $container['extensions.walker'] = function ($c) {
            return new Walker($c['command'], $c['escaper'], $c['options']);
        };

        $container['extensions.filters'] = function () {
            return new Filters();
        };

        $container['extensions.aura_html'] = function ($c) {
            return new AuraHtmlExtension(
                $c['aura.html.locator'],
                $c['options']['html_tags_functions']
            );
        };
    }