Registers services on the given container.

This method should only be used to configure services and parameters.
It should not get services.

@param Container $pimple A container instance
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);
    }
48298
public function register(Container $pimple)
    {
        $settings = $pimple->get('settings')['renderer'];
        if (is_null($settings)) {
            throw new InvalidSettingsException('Please configure the renderer settings with valid `template_path` and `template_ext` values.');
        }

        $engine = new PlatesRenderer($settings['template_path'], $settings['template_ext']);
        $engine->getEngine()->loadExtension(
            new PlatesSlimRouterExtension($pimple->get('router'))
        );

        $pimple['renderer'] = $engine;
    }
1318989
public function register(ContainerInterface $container, Configurable $config)
    {
        if (! $config instanceof Config) {
            throw new \InvalidArgumentException('Wrong Config object');
        }

        $logger = new Logger($config->name, $config->handlers);

        $container->add($config->getServiceName(), $logger);
    }
19202
public function register(Container $container)
    {
        $this->registerConfig($container);
        $this->reggisterDateHelper($container);
        $this->registerSectionServices($container);
        $this->registerNewsServices($container);
        $this->registerEventServices($container);
    }
663605
private function getBuilder(Container $pimple)
    {
        $builder = ClientBuilder::create();

        $this->setFactory($builder, $pimple);
        $this->setSender($builder, $pimple);
        $this->setLogger($builder, $pimple);

        return $builder;
    }
75689
private function registerAlias(Container $pimple)
    {
        if ($this->builderAlias) {
            $pimple[$this->builderAlias] = function () use ($pimple) {
                return $pimple['http_client.builder'];
            };
        }

        if ($this->clientAlias) {
            $pimple[$this->clientAlias] = function () use ($pimple) {
                return $pimple['http_client.client'];
            };
        }

        return $pimple;
    }
1085871
public function register(Container $pimple)
    {
        $pimple['merchant'] = function ($pimple) {
            $config = array_merge(
                ['app_id' => $pimple['config']['app_id']],
                $pimple['config']->get('payment', [])
            );

            return new Merchant($config);
        };

        $pimple['payment'] = function ($pimple) {
            return new Payment($pimple['merchant']);
        };

        $pimple['lucky_money'] = function ($pimple) {
            return new LuckyMoney($pimple['merchant']);
        };

        $pimple['merchant_pay'] = function ($pimple) {
            return new MerchantPay($pimple['merchant']);
        };

        $pimple['cash_coupon'] = function ($pimple) {
            return new CashCoupon($pimple['merchant']);
        };
    }
973301
protected function registerContextOptions(Container $container)
    {
        $defaultOptions = stream_context_get_options(stream_context_get_default());
        stream_context_set_default(array_merge(
            $defaultOptions,
            array($this->scheme => array('Container' => $container))
        ));
    }
662173
public function register(ContainerInterface $container)
    {
        $packages = [];

        // TODO : trouver comment ne pas utiliser cette constante !!!!
        $packagesFile = \Chiron\ROOT_DIR . '/bootstrap/cache/packages.php';

        if (file_exists($packagesFile)) {
            $packages = include $packagesFile;
        }

        foreach ($packages as $package) {
            if (! empty($package['providers'])) {
                array_walk($package['providers'], function ($provider) use ($container) {
                    // TODO : faire remonter la méthode "register" directement dans la classe Application
                    $container->register(new $provider);
                });
            }
        }
    }
951766
protected function registerServiceProviders( $service_providers, Container $container ) {
		foreach ( $service_providers as $provider ) {
			$provider->register( $container );
		}
	}
864340
public function register(Container $pimple)
    {
        $pimple['material'] = function ($pimple) {
            return new Material($pimple['access_token']);
        };

        $temporary = function ($pimple) {
            return new Temporary($pimple['access_token']);
        };

        $pimple['material_temporary'] = $temporary;
        $pimple['material.temporary'] = $temporary;
    }
531612
public function register(Container $container)
    {
        $closure = function (Container $container) {
            $tz = $container->get('config')->get('system.timezone', 'UTC');

            return new Chronos('now', new \DateTimeZone($tz));
        };

        $container->set(Chronos::class, $closure);
    }
941907
public function register(Container $container)
    {
        $this->container = $container;

        // Register the PHP view loader if configuration says so
        if (strtolower($container["config.service"]["view.loader"]) === "php") {
            $container->register(new PHPLoaderProvider);
        }

        // Define view class loader
        $container["loadView.service"] = $container->protect(
            function (string $view, bool $useLayout = true) use ($container) {
                $cacheName = "loadView.service-{$view}" . ($useLayout ? "1" : "0");
                if (isset($container[$cacheName]) && isset($container["view.skipCache"]) === false) {
                    return $container[$cacheName];
                }

                $class = $container["view.className"] ?? $this->getViewClass($view);
                $view = new $class(
                    $container["config.service"],
                    $container["tplLoader.service"],
                    $container["response.service"]
                );

                if (method_exists($view, "init")) {
                    $args = func_get_args();
                    $args = array_slice($args, 2);
                    $view->init(...$args);
                }

                if ($useLayout && ($layoutName = $container["config.service"]["view.defaultLayout"]) !== "") {
                    $this->setLayout($layoutName, $view);
                }

                return $container[$cacheName] = $view;
            }
        );

        $container["loadTemplate.service"] = $container->protect(
            function (string $template, bool $useLayout = true) use ($container) {
                $cacheName = "loadTemplate.service-{$template}" . ($useLayout ? "1" : "0");
                if (isset($container[$cacheName])) {
                    return $container[$cacheName];
                }

                $container["view.skipCache"] = true;
                $container["view.className"] = \SlaxWeb\View\Base::class;
                $view = $container["loadView.service"]("", false);
                $view->template = $template;
                unset($container["view.skipCache"], $container["view.className"]);

                if ($useLayout && ($layoutName = $container["config.service"]["view.defaultLayout"]) !== "") {
                    $this->setLayout($layoutName, $view);
                }

                return $container[$cacheName] = $view;
            }
        );
    }
385483
public function register(Container $pimple)
    {
        $pimple['suite.ticket'] = function ($pimple) {
            return new Ticket(
                $pimple['config']['suite']['suite_id'],
                $pimple['cache']
            );
        };

        $pimple['suite.access_token'] = function ($pimple) {
            $accessToken = new AccessToken(
                $pimple['config']['suite']['suite_id'],
                $pimple['config']['suite']['secret'],
                $pimple['cache']
            );
            $accessToken->setTicket($pimple['suite.ticket']);

            return $accessToken;
        };

        $pimple['suite.encryptor'] = function ($pimple) {
            return new Encryptor(
                $pimple['config']['suite']['suite_id'],
                $pimple['config']['suite']['token'],
                $pimple['config']['suite']['aes_key']
            );
        };

        $pimple['suite'] = function ($pimple) {
            return new Suite($pimple);
        };

        $pimple['suite.server'] = function ($pimple) {
            $server = new Guard($pimple['config']['suite']['token']);
            $server->debug($pimple['config']['debug']);
            $server->setEncryptor($pimple['suite.encryptor']);
            $server->setHandlers([
                Guard::EVENT_CREATE_AUTH  => $pimple['suite.handlers.create_auth'],
                Guard::EVENT_CANCEL_AUTH  => $pimple['suite.handlers.cancel_auth'],
                Guard::EVENT_CHANGE_AUTH  => $pimple['suite.handlers.change_auth'],
                Guard::EVENT_SUITE_TICKET => $pimple['suite.handlers.suite_ticket'],
            ]);

            return $server;
        };

        $pimple['suite.pre_auth'] = $pimple['suite.pre_authorization'] = function ($pimple) {
            return new PreAuthorization(
                $pimple['suite.access_token'],
                $pimple['request']
            );
        };

        $pimple['suite.api'] = function ($pimple) {
            return new BaseApi(
                $pimple['suite.access_token'],
                $pimple['request']
            );
        };

        $pimple['suite.authorization'] = function ($pimple) {
            return new Authorization(
                $pimple['suite.api'],
                $pimple['config']['suite']['corp_id'],
                $pimple['cache']
            );
        };

        $pimple['suite.authorizer_access_token'] = function ($pimple) {
            return new AuthorizerAccessToken(
                $pimple['config']['suite']['corp_id'],
                $pimple['suite.authorization']
            );
        };

        // Authorization events handlers.
        $pimple['suite.handlers.suite_ticket'] = function ($pimple) {
            return new EventHandlers\SuiteTicket($pimple['suite.ticket']);
        };
        $pimple['suite.handlers.create_auth'] = function () {
            return new EventHandlers\CreateAuth();
        };
        $pimple['suite.handlers.change_auth'] = function () {
            return new EventHandlers\ChangeAuth();
        };
        $pimple['suite.handlers.cancel_auth'] = function () {
            return new EventHandlers\CancelAuth();
        };

        $pimple['suite.app'] = function ($pimple) {
            return new Application($pimple['config']->toArray());
        };

        // OAuth for Suite.
        $pimple['suite.oauth'] = function ($pimple) {
            return new App($pimple['suite.authorizer_access_token']->getToken());
        };
    }
21844
public function register(Container $app)
    {
        $app["cache.service"] = function(Container $app) {
            $handlerClass = ucfirst($app["config.service"]["cache.handler"]);

            return new \SlaxWeb\Cache\Manager(
                $app["cache{$handlerClass}Handler.service"]
            );
        };

        $app["cacheFileHandler.service"] = function(Container $app) {
            return new \SlaxWeb\Cache\Handler\File(
                $app["config.service"]["cache.location"],
                $app["config.service"]["cache.maxAge"]
            );
        };
    }
679563
public static function initContainer($container)
    {
        if ($container instanceof \Pimple\Container) {
            static::$container = $container;
            static::$logger = static::$container
                ->offsetGet(\oat\oatbox\log\LoggerService::SERVICE_ID)
                ->getLogger();
        }
    }
1017017
public function register(ContainerInterface $container, Configurable $config)
    {
        if ( ! $config instanceof Config) {
            throw new \InvalidArgumentException('Wrong Config object');
        }

        $requestFilter = new RequestFilter($config);

        $container->add($config->getServiceName(), $requestFilter);
    }