Registers a service provider.

@param AbstractServiceProvider $provider An AbstractServiceProvider instance
@param array                   $values   An array of values that customizes the provider

@return Console
176009
public function registerServiceProvider(AbstractServiceProvider $provider, array $values = [])
    {
        $this->container->register($provider->setConsole($this), $values);

        return $this;
    }
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);
        });
    }
678561
protected function loadQueuedServiceProvider($provider, array $options)
    {
        $listeners = (array) Arr::get($options, 'when', []);

        foreach ($listeners as $listen) {
            $this->events->listen($listen, function () use ($provider, $options) {
                $instance = Arr::get($options, 'instance', $provider);

                $this->app->register($instance);
            });
        }
    }
143925
public function addProvider($provider)
    {
        $this->providers[] = $provider;
        $this->providers = array_unique($this->providers, SORT_REGULAR);
        $this->logDebug('Added provider: ' . get_class($provider));
    }
867999
private function registerServiceProviders()
    {
        foreach ($this->serviceProviders as $key => $serviceClass) {
            $this->container[$key] = $this->share(function () use ($serviceClass) {
                return $this->make($serviceClass);
            });
        }
    }
885305
public function registerProvider(ProviderInterface $provider, $lifeTime = 3600)
    {
        if (!$lifeTime instanceof \DateInterval) {
            $lifeTime = new \DateInterval(sprintf('PT%dS', $lifeTime));
        }

        $this->providers[$provider->getName()] = array('provider' => $provider, 'lifeTime' => $lifeTime);
    }
555610
public function registerProvider(ProviderInterface $provider)
    {
        $this->providers[$provider->getName()] = $provider;
        $this->sortProviders();

        return $this;
    }
692592
protected function loadEagerServiceProvider($provider, array $options)
    {
        if (!$options['eager']) {
            return;
        }

        $instance = Arr::get($options, 'instance', $provider);

        $this->app->register($instance);
    }
550978
public function register(ServiceProviderInterface $provider, array $values = array())
     {
         $this->registeredProviders[get_class($provider)] = true;

         parent::register($provider, $values);
     }
1112117
public function register(ServiceProviderInterface $provider, $settings = [])
    {
        $provider->register($this);
        foreach ($settings as $key => $value) {
            $this->set($key, $value);
        }

        return $this;
    }
999597
protected function bootProvider(ServiceProvider $provider)
    {
        parent::bootProvider($provider);

        if (method_exists($provider, 'booted')) {
            Event::listen('antares.extension: booted', function() use($provider) {
                Event::fire(new LoadServiceProviders());
                $this->call([$provider, 'booted']);
            });
        }
    }
59523
public function addProvider($provider)
    {
        if (!in_array($provider, $this->getServiceProviders())) {
            $quote = $this->getQuoteType('providers');
            $separator = $this->getArrayItemsSeparator('providers');
            $anchor = $this->getInsertPoint('providers');

            $insert = $separator . $quote . $provider . $quote . ',';

            $this->write($insert, $anchor);
        }
    }
105393
private function registerProviders ()
    {
        $this->register(new TwigServiceProvider());
        $this->register(new UrlGeneratorServiceProvider());
        $this->register(new ServiceControllerServiceProvider());
    }
136510
public function registerServiceProvider(array $services = []) : Application
    {
        foreach ($services as $key => $serviceProvider) {
            $this->createProvider($serviceProvider)->register($this->container);
        }

        return $this;
    }
515176
public function provider( $provider ) {

		if ( is_string( $provider ) ) {
			$provider = $this->resolveProvider( $provider );
		}

		$this->providers[] = $provider;
	}
514172
public function setProviders($providers)
    {
        $this->guardForArrayOrTraversable($providers);

        foreach ($providers as $provider) {
            $this->addProvider($provider);
        }
    }
815958
protected function registerDefaultProviders() {

		array_map( function( $provider ) {
			$this->provider( $provider );
		}, [
			AttrServiceProvider::class,
			LanguageServiceProvider::class,
			MetaServiceProvider::class,
			TemplatesServiceProvider::class,
			HierarchyServiceProvider::class,
			ViewServiceProvider::class
		] );
	}