Register the API client as a service in the container

@param Container $app
@return void
961283
public function register(Container $app)
    {
        $app['sanity.client.options'] = [
            'projectId' => null,
            'dataset' => null,
        ];

        $app['sanity.client'] = function (Application $app) {
            return new Client($app['sanity.client.options']);
        };
    }
368059
public function register(Application $app)
    {
        if ($this->registered) {
            throw new \RuntimeException('Can not re-register extensions.');
        }
        foreach ($this->extensions as $extension) {
            if ($extension->isEnabled() !== true) {
                continue;
            }
            $extension->getInnerExtension()->setContainer($app);
            foreach ($extension->getInnerExtension()->getServiceProviders() as $provider) {
                $app->register($provider);
            }
        }
        $this->registered = true;

        // @deprecated Deprecated since 3.0, to be removed in 4.0.
        $this->app = $app;
    }
435594
public function registerAutoPresenterMapper(Container $app)
    {
        $app->singleton('autopresentermapper', function () {
            return new AutoPresenterMapper();
        });

        $autoPresenter = $app->make('autopresenter');
        $autoPresenter->register(new MapperDecorator($autoPresenter, $this->app->make('autopresentermapper'), $this->app));
    }
1146027
public function register(Application $app)
    {
        $this->loadProviders();

        foreach ($this->controllerProviders as $class => $values) {
            $app->register(new $class, $values);
        }
    }
766997
protected function registerManager(Application $app)
    {
        $app->singleton('cloudflareapi', function ($app) {
            $config = $app['config'];
            $factory = $app['cloudflareapi.factory'];

            return new CloudFlareAPIManager($config, $factory);
        });

        $app->alias('cloudflareapi', 'GrahamCampbell\CloudFlareAPI\CloudFlareAPIManager');
    }
365965
public function register(Container $pimple)
    {
        $pimple = $this->setupDefaultOptions($pimple);
        $pimple = $this->registerAlias($pimple);

        $pimple['http_client.builder'] = function() use ($pimple) {
            return $this->getBuilder($pimple);
        };

        $pimple['http_client.client'] = function() use ($pimple) {
            return $pimple['http_client.builder']->build();
        };
    }
673866
public function register(Container $app): void
    {
        $app['markdown'] = function () {
            return Parsedown::instance();
        };

        $partialsCollection = new Collection();
        $app['partials'] = $partialsCollection;

        /** @var Partial[] $partials */
        $partials = []; //$config->getPartials();
        if ($partials) {
            foreach ($partials as $partial) {
                if (! $partial->getName()) {
                    throw new MissingNameForPartialException('The name of the partial to load is missing');
                }

                $partial->setParser($app['markdown']);
                if (!$partial->getContent() && $partial->getLink()) {
                    if (! is_readable($partial->getLink())) {
                        $app['monolog']->error(
                            sprintf('Partial "%s" not readable or found.', $partial->getLink())
                        );
                        continue;
                    }
                }

                $partialsCollection->set($partial->getName(), $partial);
            }
        }
    }
938017
public function resetApp(Container $app)
    {
        foreach ($this->resetters as $resetter) {
            $resetter->handle($app, $this);
        }
    }
840014
public function register(Container $app)
    {
        $app["serializer.namingStrategy"] = "CamelCase";
        $app["serializer.namingStrategy.separator"] = "_";
        $app["serializer.namingStrategy.lowerCase"] = true;

        $app["serializer.propertyNamingStrategy"] = new PropertyNamingStrategyService();
        $app["serializer.builder"] = new BuilderService();
        $app["serializer"] = function (Container $app) {
            return $app["serializer.builder"]->build();
        };
    }
463660
public function register(PimpleContainer $app)
    {
        $app['capsule.connection_defaults'] = [
            'driver'    => 'mysql',
            'host'      => 'localhost',
            'database'  => null,
            'username'  => 'root',
            'password'  => null,
            'charset'   => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix'    => null,
            'logging'   => false,
        ];

        $app['capsule.global']   = true;
        $app['capsule.eloquent'] = true;

        $app['capsule.container'] = function() {
            return new Container;
        };

        $app['capsule.dispatcher'] = function() use($app) {
            return new Dispatcher($app['capsule.container']);
        };

        $app['capsule'] = function($app) {
            $capsule = new Capsule($app['capsule.container']);
            $capsule->setEventDispatcher($app['capsule.dispatcher']);

            if ($app['capsule.global']) {
                $capsule->setAsGlobal();
            }

            if ($app['capsule.eloquent']) {
                $capsule->bootEloquent();
            }

            if (! isset($app['capsule.connections'])) {
                $app['capsule.connections'] = [
                    'default' => (isset($app['capsule.connection']) ? $app['capsule.connection'] : []),
                ];
            }

            foreach ($app['capsule.connections'] as $connection => $options) {
                $options = array_replace($app['capsule.connection_defaults'], $options);
                $logging = $options['logging'];
                unset($options['logging']);

                $capsule->addConnection($options, $connection);

                if ($logging) {
                    $capsule->connection($connection)->enableQueryLog();
                } else {
                    $capsule->connection($connection)->disableQueryLog();
                }
            }

            return $capsule;
        };
    }
322505
public function register(Container $app): void
    {
        $app[self::TEMPLATE_FOLDER] = __DIR__ . '/data/templates/';
        $app[self::CONVERTERS] = [
            '\phpDocumentor\Plugin\Scrybe\Converter\RestructuredText\ToHtml' => [Format::RST, Format::HTML],
        ];

        $app[self::FORMATS] = function () {
            return new Converter\Format\Collection();
        };

        $app[self::CONVERTER_DEFINITION_FACTORY] = function ($container) {
            return new Factory($container[self::FORMATS]);
        };

        $app[self::CONVERTER_FACTORY] = function ($container) {
            return new Converter\Factory(
                $container['converters'],
                $container['converter_definition_factory'],
                $container['monolog']
            );
        };

        $app[self::TEMPLATE_FACTORY] = function ($app) {
            return new Template\Factory(
                ['twig' => new Template\Twig($app[self::TEMPLATE_FOLDER])]
            );
        };

        $this->addCommands($app);
    }
776226
public function bootstrap(Container $app) {
	    $extensions = $this->manager->getAvailableExtensions()->filterByActivated();

        $this->dispatcher->registerCollection($extensions);
        $this->dispatcher->boot();
	}
668814
public function register(Container $app)
    {
        $app["cors.allowOrigin"] = "*"; // Defaults to all
        $app["cors.allowMethods"] = null; // Defaults to all
        $app["cors.allowHeaders"] = null; // Defaults to all
        $app["cors.maxAge"] = null;
        $app["cors.allowCredentials"] = null;
        $app["cors.exposeHeaders"] = null;

        $app["allow"] = $app->protect(new Allow());

        $app["options"] = $app->protect(function ($subject) use ($app) {
            $optionsController = function () {
                return Response::create("", 204);
            };

            if ($subject instanceof Controller) {
                $optionsRoute = $app->options($subject->getRoute()->getPath(), $optionsController)
                    ->after($app["allow"]);
            } else {
                $optionsRoute = $subject->options("{path}", $optionsController)
                    ->after($app["allow"])
                    ->assert("path", ".*");
            }

            return $optionsRoute;
        });

        $app["cors-enabled"] = $app->protect(function ($subject, $config = []) use ($app) {
            $optionsController = $app["options"]($subject);
            $cors = new Cors($config);

            if ($subject instanceof Controller) {
                $optionsController->after($cors);
            }

            $subject->after($cors);

            return $subject;
        });

        $app["cors"] = function () use ($app) {
            $app["options"]($app);
            return new Cors();
        };
    }
219824
protected function setupEventListening(Container $app)
    {
        $app['events']->listen('content.rendering', function (View $view) use ($app) {
            if ($viewData = array_merge($view->getFactory()->getShared(), $view->getData())) {
                $decorator = $app['autopresenter'];
                foreach ($viewData as $key => $value) {
                    $view[$key] = $decorator->decorate($value);
                }
            }
        });
    }
613530
public function register(ServiceContainer $container)
    {
        if ($this->registrationFunction !== null) {
            call_user_func($this->registrationFunction, $container);
        }
    }
873198
public function register(Application $app)
    {
        $this->setup($app);
        $app
            ->offsetGet('console')
            ->getHelperSet()
            ->set(new ConnectionHelper($app->offsetGet('connection')), 'connection')
        ;
    }
777610
public function register(App $app)
    {
        $app["logger.service"] = $app->protect(
            function (string $loggerName = "") use ($app) {
                $cacheName = "logger.service-{$loggerName}";
                if (isset($app[$cacheName])) {
                    return $app[$cacheName];
                }
                /*
                 * Check the config service has been defined and provides correct
                 * object
                 */
                if (isset($app["config.service"]) === false
                    || get_class($app["config.service"]) !== "SlaxWeb\\Config\\Container") {
                    throw new \SlaxWeb\Bootstrap\Exception\LoggerConfigException(
                        "Config component provider must be registered before you can use the Logger component."
                    );
                }

                $config = $app["config.service"];
                if ($loggerName === "") {
                    $loggerName = $config["logger.defaultLogger"];
                }

                $logger = new MLogger($loggerName);
                foreach ($config["logger.loggerSettings"][$loggerName] as $type => $settings) {
                    // load propper handler and instantiate the Monolog\Logger
                    $handler = null;
                    switch ($type) {
                        case Helper::L_TYPE_FILE:
                            $app["temp.logger.settings"] = $settings;
                            $handler = $app["logger.{$type}.service"];
                            unset($app["temp.logger.settings"]);
                            break;
                        default:
                            throw new \SlaxWeb\Bootstrap\Exception\UnknownLoggerHandlerException(
                                "The handler you are tring to use is not known or not supported."
                            );
                    }
                    $logger->pushHandler($handler);
                }

                return $app[$cacheName] = $logger;
            }
        );

        $app["logger.StreamHandler.service"] = $app->factory(
            function (App $cont) {
                $settings = $cont["temp.logger.settings"];

                // if the log file name does not begin with a dir separator, treat
                // it as relative path and prepend 'logFilePath'
                if ($settings[0][0] !== DIRECTORY_SEPARATOR) {
                    $settings[0] = ($cont["config.service"]["logger.logFilePath"] ?? "")
                        . $settings[0];
                }
                return new \Monolog\Handler\StreamHandler(...$settings);
            }
        );
    }