Registers services on the given container.

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

@param \Pimple $container An Container instance
507862
public function register(\Pimple $container)
    {
        $services = new \Pimple();
        $services['factory'] = $container->share(function () use ($container) {
            return new \Itkg\Core\Cache\Factory($container['cache']['adapters']);
        });

        $services['listener'] = $container->share(function () use ($services, $container) {
            return new CacheListener(
                $services['factory']->create(
                    $container['config']['cache']['adapter'],
                    $container['config']['cache']
                ),
                $container['core']['dispatcher']
            );
        });

        $container['cache'] = $services;
    }
873611
public function register(Container $container)
    {
        /** @var Config $configuration */
        $configuration = $container['config'];

        $client = new Client([
            'timeout' => $configuration->timeout,
            'verify' => $configuration->sslVerifyHost,
        ]);

        return $client;
    }
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);
    }
664002
public function register(Container $container)
    {
        $container['aura.html.locatorFactory'] = function () {
            return new HelperLocatorFactory();
        };
        $container['aura.html.locator'] = function (Container $container) {
            return $container['aura.html.locatorFactory']->newInstance();
        };
        $container['aura.html.escaper'] = function (Container $container) {
            return $container['aura.html.locator']->escape();
        };
    }
773081
public function register(Container $pimple)
    {
        $pimple['logger'] = $pimple['log'] = function ($app) {
            $config = $this->formatLogConfig($app);

            if (!empty($config)) {
                $app->rebind('config', $app['config']->merge($config));
            }

            return new LogManager($app);
        };
    }
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;
            }
        );
    }
487527
public function register(Container $container)
    {
        /** @var string The default route controller for templates. */
        $container['route/controller/script/class'] = ScriptRoute::class;

        $this->registerScriptFactory($container);
        $this->registerClimate($container);
    }
1354977
public function register(Container $app)
    {
        $app[DataInterface::class] = $app->factory(Data::class);
        $app[ConfigInterface::class] = $app->factory(FileConfig::class);
    }
938104
public function register(Container $container)
    {
        $this->registerFinder($container);
        $this->registerSections($container);
        $this->registerTemplate($container);
        $this->registerEngine($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'
                ]
            ]);
        };
    }
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);
    }
319283
public function register(Container $container)
    {
        // Authentication
        $container->share(Authentication::class, [$this, 'authentication'])
            ->bindShared(AuthenticationInterface::class, Authentication::class);

        // Authorisation
        $container->share(Authorisation::class, [$this, 'authorisation'])
            ->bindShared(AuthorisationInterface::class, Authorisation::class);

        // User Handler
        $this->prepareHandler($container);

        // User Manager
        $container->prepareSharedObject(UserManager::class);
    }
519985
public function register(Container $pimple)
    {
        $pimple['user'] = function ($pimple) {
            return new User($pimple['access_token']);
        };

        $department = function ($pimple) {
            return new Department($pimple['access_token']);
        };

        $tag = function ($pimple) {
            return new Tag($pimple['access_token']);
        };

        $batch = function ($pimple) {
            return new Batch($pimple['access_token']);
        };

        $pimple['department'] = $department;
        $pimple['party'] = $department;

        $pimple['user_party'] = $department;
        $pimple['user.party'] = $department;

        $pimple['user_department'] = $department;
        $pimple['user.department'] = $department;

        $pimple['tag'] = $tag;

        $pimple['user_tag'] = $tag;
        $pimple['user.tag'] = $tag;

        $pimple['user_batch'] = $batch;
        $pimple['user.batch'] = $batch;
    }
135989
public function register(Container $container)
    {
        $container->prepareSharedObject(ErrorManager::class, function (ErrorManager $error, Container $container) {
            foreach ((array) $this->config->get('error.handlers', []) as $key => $handler) {
                if (is_string($handler)) {
                    $handler = $container->newInstance($handler);
                }

                $error->addHandler($handler, is_numeric($key) ? null : $key);
            }

            return $error;
        });

        $container->extend(LoggerManager::class, function (LoggerManager $manager, Container $container) {
            if ($container->get('config')->get('error.log', false)) {
                $logger = $manager->createRotatingLogger('error', LogLevel::ERROR);
            } else {
                $logger = new NullLogger();
            }

            $manager->addLogger('error', $logger);

            return $manager;
        });
    }
1279698
public function register(Container $container)
    {
        /** @var Config $configuration */
        $configuration = $container['config'];

        /** @var LoggerInterface $logger */
        $logger = $container['logger'];

        /** @var Client $http */
        $http = $container['http'];

        /** @var TierConfiguration $tierConfiguration */
        $tierConfiguration = $container['tierConfiguration'];

        /** @var Fulfillment $fulfillment */
        $fulfillment = $container['fulfillment'];

        return new Usage($configuration, $logger, $http, $tierConfiguration, $fulfillment);
    }
135157
public function register(Container $pimple)
    {
        $pimple['server'] = function ($pimple) {
            $server = new Server($pimple['config'], $pimple['request']);

            $server->debug($pimple['config']['debug']);

            return $server;
        };
    }
761843
public function register(Container $container)
    {
        $container->share(MatcherInterface::class, [$this, 'matcher']);

        $container->prepareSharedObject(RouteCreator::class);
        $container->prepareSharedObject(MainRouter::class);
    }