Registers a service.
352844
final public function set(string $id, string $class = null): ServiceConfigurator
    {
        $this->__destruct();

        return $this->parent->set($id, $class);
    }
1086179
protected function registerMigrationService(): void
    {
        $config = $this->app['config'];
        $config->set('database.migrations', $config->get('database.migrations') ?: 'migrations');
        $this->app->register(\Illuminate\Database\MigrationServiceProvider::class);

        $this->app->alias(
            'migration.repository',
            \Illuminate\Database\Migrations\MigrationRepositoryInterface::class
        );

        $this->app->singleton(
            'migrator',
            function ($app) {
                $repository = $app['migration.repository'];

                return new Migrator($repository, $app['db'], $app['files']);
            }
        );

        $this->app->alias(
            'migrator',
            \Illuminate\Database\Migrations\Migrator::class
        );
    }
1366735
protected function registerServiceProviders()
    {
        $list = new ProviderList(Core::getFacadeRoot());

        foreach ($this->providers as $provider) {
            $list->registerProvider($provider);

            if (method_exists($provider, 'boot')) {
                Core::make($provider)->boot($this);
            }
        }
    }
61790
public function register()
    {
        $this->container->bind('config', new Repository(
            new FileLoader(
                new Filesystem,
                $this->container->appPath().'/config'
            ),
            new Resolver,
            $this->container->os()
        ));
    }
363418
public function register()
    {
        if (! $this->config->shouldIntegrateHorizon) {
            return;
        }

        $this->config->loadHorizonConfiguration();

        $this->registerServices();

        if ($this->shouldRebindHorizonRedisFactory()) {
            $this->rebindHorizonRedisFactory();
        }
    }
1189162
public function registerServiceProvider()
    {
        $this->registerConfig();
        $this->registerClassAliases();
        $this->registerHttpServiceProvider();
        $this->registerRoutingServiceProvider();
        $this->registerExceptionHandler();
        $this->registerDispatcher();
        $this->registerAuth();
        $this->registerTransformer();
        $this->registerDocsCommand();

        if (class_exists(\Illuminate\Foundation\Application::class, false)) {
            $this->commands([
                NodesConsoleCommandCache::class,
                NodesConsoleCommandRoutes::class,
            ]);
        }
    }
1150386
public function register()
    {
        $this->registerBindingsServiceProviderMakeCommand();
        $this->registerMakeCommand();
        $this->registerRepositoryInterfaceMakeCommand();
        $this->registerServiceMakeCommand();
        $this->registerTraitMakeCommand();
    }
981901
public function register()
	{
		$logger = new Writer(
			new Logger($this->app['env']), $this->app['events']
		);

		$this->app->instance('log', $logger);

		// If the setup Closure has been bound in the container, we will resolve it
		// and pass in the logger instance. This allows this to defer all of the
		// logger class setup until the last possible second, improving speed.
		if (isset($this->app['log.setup']))
		{
			call_user_func($this->app['log.setup'], $logger);
		}
	}
887940
public function register()
    {
        $this->registerConfig();

        $this->registerClassAliases();

        $this->app->register(RoutingServiceProvider::class);

        $this->app->register(HttpServiceProvider::class);

        $this->registerExceptionHandler();

        $this->registerDispatcher();

        $this->registerAuth();

        $this->registerTransformer();

        $this->registerDocsCommand();
    }
1251961
def service(container, name=None):
    
    def register(service):
        container.add_service(service, name)
        return service

    return register
1196922
public function register()
    {
        if ($this->app->environment() !== 'production') {
            $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
        }
        // ...
    }
1146006
protected function registerServices()
    {
        $this->app->bind(
            'Xuma\Amaran\ViewBinder',
            'Xuma\Amaran\AmaranViewBinder'
        );

        $this->app->singleton('amaran', function($app) {
            $binder = new AmaranViewBinder($app['events']);

            return $this->app->make('Xuma\Amaran\AmaranHandler');
        });
    }
483469
public void registerService(ProvidedServiceInstance serviceInstance, ServiceInstanceHealth registryHealth) {
        // Monitor disabled ProvidedServiceInstance should not have the ServiceInstanceHealth.
        if(serviceInstance.isMonitorEnabled()== false){
            throw new ServiceException(ErrorCode.SERVICE_INSTANCE_HEALTH_ERROR);
        }
        registerService(serviceInstance);
    }
1326388
protected function registerService()
	{
	    $this->app->singleton($this->getProviderKey(), function($app)
	    {
	    	return new Service($this->getProviderKey(), new Processor($this->getAggregateService()), $this->getAggregateService());
	    });
	}
1158362
public function register()
    {
        $displayer = new BasicDisplayer;
        $handler = new Handler($displayer);
        $this->container->bind('error', $handler);
    }
1178601
synchronized void registerService(Promotable service)
    {
        m_services.add(service);
        if (m_isLeader) {
            try {
                service.acceptPromotion();
            }
            catch (Exception e) {
                VoltDB.crashLocalVoltDB("Unable to promote global service.", true, e);
            }
        }
    }
858100
public function register()
    {
        $this->setupConfig();

        $services = config('microservice.services');
        $currentEnv = app()->environment();

        /** @var array $services */
        foreach ($services as $service) {
            if ($service['enabled'] && $this->isInCurrentEnv($currentEnv, $service['environments'])) {
                if (array_get($service, 'config')) {
                    $this->app->configure($service['config']);
                }

                $this->app->register($service['provider']);
            }
        }

        app()->middleware(ConvertEmptyStringsToNull::class);
    }