Register the application service providers.

@param  \Nova\Foundation\Application  $app
@param  array  $providers
@return void
517491
public function load(Application $app, array $providers)
    {
        $manifest = $this->loadManifest();

        // First we will load the service manifest, which contains information on all
        // service providers registered with the application and which services it
        // provides. This is used to know which services are "deferred" loaders.
        if ($this->shouldRecompile($manifest, $providers)) {
            $manifest = $this->compileManifest($app, $providers);
        }

        // If the application is running in the console, we will not lazy load any of
        // the service providers. This is mainly because it's not as necessary for
        // performance and also so any provided Artisan commands get registered.
        if ($app->runningInConsole()) {
            $manifest['eager'] = $manifest['providers'];
        }

        // Next, we will register events to load the providers for each of the events
        // that it has requested. This allows the service provider to defer itself
        // while still getting automatically loaded when a certain event occurs.
        foreach ($manifest['when'] as $provider => $events) {
            $this->registerLoadEvents($app, $provider, $events);
        }

        // We will go ahead and register all of the eagerly loaded providers with the
        // application so their services can be registered with the application as
        // a provided service. Then we will set the deferred service list on it.
        foreach ($manifest['eager'] as $provider) {
            $app->register($this->createProvider($app, $provider));
        }

        $app->setDeferredServices($manifest['deferred']);
    }
1255106
public function registerProvider($provider){
        $providers = (array) $provider;

        foreach($providers as $provider){
            $this->app()['config']->add('general.providers', $provider);
        }
    }
1294580
public function register(Application $app)
    {
        $this->loadConfigurations($app);
        $this->registerServices($app);
        $this->registerEventListener($app);
    }
1072462
public function register(App $app)
    {
        if (isset($app["guzzle.service"]) === false) {
            $app["guzzleClient.service"] = function() {
                return new \GuzzleHttp\Client;
            };
        }

        /*
         * This is only a temporary service definition to satisfy the install component
         * command and to load the service provider into it through the new params
         * as services method.
         *
         * @todo: remove when the component commands are refactored
         */
        $app["serviceProvider.service"] = function(App $app) {
            return $app;
        };

        $app["slaxerCommands"] = array_merge(
            $app["slaxerCommands"] ?? [],
            [
                \SlaxWeb\Bootstrap\Commands\Component\InstallCommand::class => [
                    "serviceProvider.service",
                    "guzzleClient.service"
                ]
            ]
        );
    }
1190183
public static function registerServices(Application $app)
    {
        $file = $app['wise.options']['config']['services'];

        if ('prod' !== $app['wise.options']['mode']) {
            $file .= '_' . $app['wise.options']['mode'];
        }

        $file .= '.' . $app['wise.options']['type'];

        /** @var $wise Wise */
        $wise = $app['wise'];
        $services = $wise->load($file);

        unset($services['parameters']);
        unset($services['imports']);

        foreach ($services as $name => $service) {
            if (null === $service) {
                continue;
            }

            if (!isset($service['class'])) {
                throw InvalidArgumentException::format(
                    'The service "%s" did not specify its "class".',
                    $name
                );
            }

            if (!isset($service['parameters'])) {
                $service['parameters'] = array();
            }

            $app->register(new $service['class'](), $service['parameters']);
        }
    }
200833
protected function resolveApplicationConfiguration($app)
    {
        $app->make('Illuminate\Foundation\Bootstrap\LoadConfiguration')->bootstrap($app);

        \tap($this->getApplicationTimezone($app), function ($timezone) {
            ! \is_null($timezone) && \date_default_timezone_set($timezone);
        });

        $app['config']['app.aliases'] = $this->resolveApplicationAliases($app);
        $app['config']['app.providers'] = $this->resolveApplicationProviders($app);
    }
1354977
public function register(Container $app)
    {
        $app[DataInterface::class] = $app->factory(Data::class);
        $app[ConfigInterface::class] = $app->factory(FileConfig::class);
    }
536859
protected function registerUserProvider(\Silex\Application $app)
    {
        $user_provider       = 'security.user_provider.'.$this->name;
        $app[$user_provider] = $app->share(function () {
            return new ChainUserProvider($this->userProviders);
        });
        return $user_provider;
    }
688744
public function register(Application $app)
    {
        foreach ($this->services as $key => $class) {
            if (is_numeric($key)) {
                $key = $class;
            }
            $app[$key] = $app->share(function() use ($class, $app) {
                $result = new $class();
                $app->initialize($result);
                return $result;
            });
        }

        if (!empty($this->doctrineEventSubscribers)) {
            $config = $app['config'];
            foreach ($this->doctrineEventSubscribers as $class) {
                $config['orm.subscribers'][] = $class;
            }
        }

        if (!empty($this->entityFolders)) {
            if (!isset($config)) {
                $config = $app['config'];
            }
            foreach ($this->entityFolders as $namespace => $path) {
                $config['orm.options']['orm.em.options']['mappings'][] = [
                    'type' => 'annotation',
                    'namespace' => $namespace,
                    'path' => $path,
                    'use_simple_annotation_reader' => false,
                ];
            }
        }

        if (isset($config)) {
            $app['config'] = $config;
        }

        if (php_sapi_name() === 'cli' && !empty($this->commands)) {
            $app['base_commands'] = $app->extend('base_commands', function(array $commands) {
                return array_merge($commands, $this->commands);
            });
        }
    }
856744
public function register(App $app)
    {
        $app["config.service"] = function (App $app) {
            return new \SlaxWeb\Config\Container(
                $app["configHandler.service"]
            );
        };

        $app["configHandler.service"] = function (App $app) {
            switch ($app["configHandler"]) {
                case \SlaxWeb\Config\Container::PHP_CONFIG_HANDLER:
                    return new \SlaxWeb\Config\PhpHandler(
                        [$app["configResourceLocation"]]
                    );
                case \SlaxWeb\Config\Container::XML_CONFIG_HANDLER:
                    return new \SlaxWeb\Config\XmlHandler(
                        [$app["configResourceLocation"]],
                        new \Desperado\XmlBundle\Model\XmlReader
                    );
                case \SlaxWeb\Config\Container::YAML_CONFIG_HANDLER:
                    return new \SlaxWeb\Config\YamlHandler(
                        [$app["configResourceLocation"]]
                    );
                default:
                    $availOpts = [
                        \SlaxWeb\Config\Container::PHP_CONFIG_HANDLER,
                        \SlaxWeb\Config\Container::XML_CONFIG_HANDLER,
                        \SlaxWeb\Config\Container::YAML_CONFIG_HANDLER
                    ];
                    throw new \SlaxWeb\Bootstrap\Exception\InvalidConfigHandlerException(
                        "Handler type property 'configHandler' must be one of "
                        . json_encode($availOpts)
                    );
            }
        };
    }
390304
public function register()
    {   
        $providers = config('app','core_providers');
        foreach ($providers as $key => $value) {
            $this->getContainer()->add($value);
        }
    }
54712
public function boot(ProviderRepository $providers)
    {
        if ($this->app->runningInConsole()) {
            $this->registerMigrations();
        }

        $this->createAccessTokenProvider($providers);

        // Register the middleware as singleton to use the same middleware
        // instance when the handle and terminate methods are called.
        $this->app->singleton(\SMartins\PassportMultiauth\Http\Middleware\AddCustomProvider::class);
    }
1212872
private function registerComponents($app)
    {
        foreach ($this->getModules() as $id => $module) {
            // set an alias for all user modules
            Yii::setAlias('@'.$id, $module->getBasePath());
            // see if the module has a registerComponents method
            foreach ($module->registerComponents() as $componentId => $definition) {
                if (!$app->has($componentId)) {
                    Yii::trace('Register component ' . $componentId, __METHOD__);
                    $app->set($componentId, $definition);
                }
            }
        }
    }
656349
public function register(Application $app)
    {
        $this->em = new ClientEntityManager($app);

        $this->modelManagerFactory = $app['clients.model_manager.factory'];

        // Default options.
        $app['clients.options.default'] = array(
            // Specify custom view templates here.
            'templates' => array(
                'view' => '@clients/view.twig',
                'edit' => '@clients/edit.twig',
                'list' => '@clients/list.twig',
                'create' => '@clients/create.twig',
                'remove' => '@clients/remove.twig',
            )
        );


        // Initialize $app['clients.options'].
        $app['clients.options.init'] = $app->protect(function() use ($app) {
            $options = $app['clients.options.default'];

            if (isset($app['clients.options'])) {
                $options = array_replace_recursive($options, $app['clients.options']);
            }

            $app['clients.options'] = $options;
        });

        // User controller service.
        $app['clients.controller'] = $app->share(function ($app) {
            //$app['clients.options.init']();
            $controller = new ClientController($app['clients.model_manager.factory']);

            return $controller;
        });

        /*
         *  Not sure it goes there
         */
        $app->before(function () use ($app) {
            $app['twig']->addGlobal('layout', null);
            $app['twig']->addGlobal('layout', $app['twig']->loadTemplate('layout.twig'));
        });

    }
979851
public function registerConfiguredProviders(){
			//Count Providers Array in Config
		if (is_array($this['config']->get('plugin.providers'))) {
			foreach ($this['config']->get('plugin.providers') as $index => $namespace) {
				$this->register($namespace);
			}
		}
	}
1018862
protected function registerLoadEvents($provider, array $events)
    {
        if (count($events) < 1) {
            return;
        }

        $this->app->make('events')->listen($events, function () use ($provider) {
            $this->app->register($provider);
        });
    }
802221
public function register(Application $app)
    {
        /** @var Translator $translator  */
        $translator = $app['translator'];
        $translator->addTranslationFolder(__DIR__ . DIRECTORY_SEPARATOR . 'Messages');

        /** @var ApplicationConfiguration $config */
        $config = $app['config'];

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

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

                $content = '';
                if ($partial->getContent()) {
                    $content = $partial->getContent();
                } elseif ($partial->getLink()) {
                    if (! is_readable($partial->getLink())) {
                        $app['monolog']->error(
                            sprintf($translator->translate('PPCPP:EXC-NOPARTIAL'), $partial->getLink())
                        );
                        continue;
                    }

                    $content = file_get_contents($partial->getLink());
                }
                $partialsCollection->set($partial->getName(), $content);
            }
        }
    }