Set the appProviders in the main application object and set the provides array for registering the sevice providers
@param [type] $providers [description]
506344
private function setProviders($providers) {
        foreach ($providers as $key => $value) {
            $this->provides[] = $value;
            $this->app->appProviders[] = [$key=>$value];
        }
    }
1112117
public function register(ServiceProviderInterface $provider, $settings = [])
    {
        $provider->register($this);
        foreach ($settings as $key => $value) {
            $this->set($key, $value);
        }

        return $this;
    }
460059
protected function setInitialProviders()
    {
        $app = $this->getBaseApp();
        $providers = $this->config->get('swoole_http.providers', []);

        foreach ($providers as $provider) {
            if (class_exists($provider) && ! in_array($provider, $this->providers)) {
                $providerClass = new $provider($app);
                $this->providers[$provider] = $providerClass;
            }
        }
    }
951766
protected function registerServiceProviders( $service_providers, Container $container ) {
		foreach ( $service_providers as $provider ) {
			$provider->register( $container );
		}
	}
554678
public function setAuthProviders(array $params = array())
	{
		if (!isset($params['providers'])) {
			throw new MissingArgumentException('providers');
		}

		if (!is_array($params['providers'])) {
			throw new InvalidArgumentException('Invalid Argument: providers must be passed as array');
		}

		$params['providers'] = json_encode(array_values($params['providers']));

		return $this->post('set_auth_providers', $params);
	}
278754
public void setProviders(Map<String, IPermissionTargetProvider> providers) {
        this.providers.clear();
        for (Map.Entry<String, IPermissionTargetProvider> provider : providers.entrySet()) {
            this.providers.put(provider.getKey(), provider.getValue());
        }
    }
631672
public function setProvider( $provider )
	{
		if ( $provider == $this->getProvider() ) { return; }

		$this->_values['provider'] = (string) $provider;
		$this->setModified();
	}
162175
private function init_theme_providers()
    {
        foreach (Config::get('services.theme_providers') as $class_name) {
            if (\is_subclass_of($class_name, \Snap\Services\Service_Provider::class)) {
                $provider = Container::resolve($class_name);
                Container::resolve_method($provider, 'register');
                return;
            }
        }
    }
1300536
public function registerProviders(array $providers = []): self
    {
        foreach ($providers as $provider) {
            $this->registerProvider($provider);
        }

        return $this;
    }
769435
public function validateProviders(array $providers) : void
    {
        Assert::allClassExists($providers);
        Assert::allImplementsInterface($providers, self::PROVIDER_INTERFACE);

        foreach ($this->requiredProviders as $name) {
            if (!in_array($name, array_keys($providers))) {
                throw new InvalidArgumentException("Configuration is missing a required provider for [$name]");
            }
        }
    }
1015168
public function registerServices()
    {
        $this['serviceProviders'] = $this->serviceProviders;

        foreach ($this->serviceProviders as $providerArray) {
            list($provider,$enabled) = $providerArray;

            if (!$enabled) {
                continue;
            }

            if (empty($provider) || !class_exists($provider)) {
                continue;
            }

            $provider = new $provider(self::$instance);
            $provider->register();
        }
    }
1353357
protected function registerHorizonServiceProvider()
    {
        $namespace = Str::replaceLast('\\', '', $this->getAppNamespace());

        $appConfig = file_get_contents(config_path('app.php'));

        if (Str::contains($appConfig, $namespace.'\\Providers\\HorizonServiceProvider::class')) {
            return;
        }

        file_put_contents(config_path('app.php'), str_replace(
            "{$namespace}\\Providers\EventServiceProvider::class,".PHP_EOL,
            "{$namespace}\\Providers\EventServiceProvider::class,".PHP_EOL."        {$namespace}\Providers\HorizonServiceProvider::class,".PHP_EOL,
            $appConfig
        ));

        file_put_contents(app_path('Providers/HorizonServiceProvider.php'), str_replace(
            "namespace App\Providers;",
            "namespace {$namespace}\Providers;",
            file_get_contents(app_path('Providers/HorizonServiceProvider.php'))
        ));
    }
1102758
public function registerProvidersFor($binding)
    {
        foreach ($this->provides($binding) as $provider) {
            $this->registerProvider($provider, true, $binding);
        }
    }
669311
public function addProvider($provider) {
        $this->validateProvider($provider);

        if (is_object($provider)) {
            $class = get_class($provider);
            $instance = $provider;
        } else {
            $class = $provider;
            $instance = null;
        }

        if ( ! array_has($this->providers, $class)) {
            $this->providers[$class] = [
                'instance' => $instance,
                'tags' => [],
            ];
        }
    }
538979
protected function registerProviders()
    {
        /** @var Container $container */
        $container = $this->getContainer();

        // Register Aliases
        $aliases = (array) $this->get('di.aliases');

        foreach ($aliases as $alias => $target) {
            $container->alias($alias, $target);
        }

        $container->registerServiceProvider(new SystemProvider($this, $this->config));

        $providers = (array) $this->config->get('providers');

        foreach ($providers as $interface => &$provider) {
            if ($provider === false) {
                continue;
            }

            if (is_subclass_of($provider, ServiceProviderInterface::class)) {
                // Handle provider
                if ($provider instanceof ClassMeta || (is_string($provider) && class_exists($provider))) {
                    $provider = $container->newInstance($provider);
                }

                if ($provider === false) {
                    continue;
                }

                $container->registerServiceProvider($provider);

                if ($provider instanceof BootableProviderInterface
                    || method_exists($provider, 'boot')) {
                    $provider->boot($container);
                }
            } else {
                // Handle Service
                if (is_numeric($interface)) {
                    $container->prepareSharedObject($provider);
                } else {
                    $container->bindShared($interface, $provider);
                }
            }
        }

        foreach ($providers as $provider) {
            if ($provider === false) {
                continue;
            }

            if (is_subclass_of($provider, ServiceProviderInterface::class)
                && (
                    $provider instanceof BootableDeferredProviderInterface
                    || method_exists($provider, 'bootDeferred')
                )) {
                $provider->bootDeferred($container);
            }
        }
    }
760337
public function registerProvider(Provider $provider): self
    {
        $this->providers[$provider->getName()] = $provider;

        return $this;
    }
687356
protected function registerProviders()
    {
        $providers = $this->def('provider');

        if ($providers)
        {
            if (is_array($providers))
            {
                foreach ($providers as $provider)
                {
                    $this->app->register($instance = new $provider($this->app));
                }
            }
            else
            {
                $this->app->register($instence = new $providers($this->app));
            }
        }
    }