Registers the service provider with a DI container.

@param   Container $container The DI container.

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

        $container->prepareSharedObject(RouteCreator::class);
        $container->prepareSharedObject(MainRouter::class);
    }
335003
public function register(\Pimple\Container $container)
    {
        $this->define();
        foreach ($this->hooks as $hookName => $hookDef) {
            $hook = $container["newHook.factory"];
            $hook->create($hookName, $hookDef);
            $container["hooks.service"]->addHook($hook);
        }
    }
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);
    }
1325869
protected function setDependencies(Container $container)
    {
        $this->setTranslator($container['translator']);
        $this->setAuthenticator($container['authenticator']);
        $this->setAuthorizer($container['authorizer']);
    }
1189704
protected function setDependencies(Container $container)
    {
        parent::setDependencies($container);

        $this->setAppConfig($container['config']);
        $this->setModelFactory($container['model/factory']);
    }
769865
public function register(Container $container)
    {
        $container->share(\Swift_Mailer::class, [$this, 'swiftmailer'])
            ->alias('swiftmailer', \Swift_Mailer::class);

        $container->bindShared(MailerAdapterInterface::class, SwiftMailerAdapter::class)
            ->alias('mailer.adapter.swiftmailer', SwiftMailerAdapter::class);
    }
134522
public function register(Container $container)
    {
        $container->prepareSharedObject(CsrfGuard::class)
            ->alias('security.csrf', CsrfGuard::class);

        // Always new instance in every usage
        $container->bind(CipherInterface::class, function (Container $container) {
            $config = $container->get('config');
            $class  = $this->getCipher($config->get('crypt.cipher', 'blowfish'));

            return $container->newInstance($class);
        });

        $container->share(Crypt::class, function (Container $container) {
            $config = $container->get('config');
            $key    = md5('Windwalker-Crypt::' . $config->get('system.secret'));

            return $container->newInstance(Crypt::class, ['key' => $key]);
        })->bindShared(CryptInterface::class, Crypt::class);

        $container->prepareSharedObject(ModernPassword::class)
            ->bindShared(HasherInterface::class, ModernPassword::class)
            ->bindShared(Password::class, ModernPassword::class);
    }
873611
public function register(Container $container)
    {
        /** @var Config $configuration */
        $configuration = $container['config'];

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

        return $client;
    }
596755
public function register(Container $container)
    {
        $container["tplLoader.service"] = function (Container $container) {
            $loader = new \SlaxWeb\View\Loader\PHP($container["response.service"], $container["logger.service"]());
            return $loader->setTemplateExt($container["config.service"]["view.templateExtension"]);
        };
    }
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();
        };
    }
800206
public function register(Container $container)
    {
        // Ensure dependencies are set
        $container->register(new EmailServiceProvider());
        $container->register(new UiServiceProvider());
        $container->register(new AssetsManagerServiceProvider());

        $this->registerAdminServices($container);
        $this->registerFactoryServices($container);
        $this->registerElfinderServices($container);
        $this->registerSelectizeServices($container);
        $this->registerMetadataExtensions($container);
        $this->registerAuthExtensions($container);
        $this->registerViewExtensions($container);
        $this->registerAssetsManager($container);

        // Register Access-Control-List (acl)
        $container->register(new AclServiceProvider());
    }
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);
    }
127004
public function register(Container $container)
    {
        /** @var Config $configuration */
        $configuration = $container['config'];

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

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

        return new TierConfiguration($configuration, $logger, $http, $container);
    }
529829
public function register(Container $container)
    {
        $settings = $container->get('settings');

        if (!isset($settings['logger'])) {
            throw new InvalidArgumentException('Logger configuration not found');
        }

        $basename = isset($settings['basename']) ? $settings['basename'] : 'slim-app';

        $container['logger'] = new Monolog($basename, $settings['logger']);
    }
1075691
public function register(Container $container)
    {
        $container->register(new CacheServiceProvider());
        $container->register(new DatabaseServiceProvider());
        $container->register(new FilesystemServiceProvider());
        $container->register(new LoggerServiceProvider());
        $container->register(new ScriptServiceProvider());
        $container->register(new TranslatorServiceProvider());
        $container->register(new ViewServiceProvider());

        $this->registerKernelServices($container);
        $this->registerHandlerServices($container);
        $this->registerRouteServices($container);
        $this->registerMiddlewareServices($container);
        $this->registerRequestControllerServices($container);
        $this->registerModuleServices($container);
        $this->registerViewServices($container);
    }
397733
public function register(Container $container)
    {
        if (!isset($container->get('settings')['view'])) {
            throw new InvalidArgumentException('Template configuration not found');
        }

        $engine = new Plates(
            $container->get('settings')['view'],
            $container->get('response')
        );

        $engine->loadExtension(
            new PlatesExtension(
                $container->get('router'),
                $container->get('request')->getUri()
            )
        );

        $container['view'] = $engine;
    }
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))
        ));
    }