tryRegisterProviders method.

@param $on
979881
protected function tryRegisterProviders($on)
    {
        if ($on === $this->registerProvidersOn && $this->registerProvidersMethod === self::METHOD_REGISTER) {
            // FIRST register all given providers
            foreach ($this->providers as $provider) {
                $this->app->register($provider);
            }

            foreach ($this->deferredProviders as $provider) {
                $this->app->registerDeferredProvider($provider);
            }
        } elseif ($this->registerProvidersMethod === self::METHOD_RESOLVE) {
            foreach ($this->providers as $provider) {
                $resolved = $this->app->resolveProviderClass($registered[] = $provider);
                if ($on === self::ON_REGISTER) {
                    $resolved->register();
                } elseif ($on === self::ON_BOOT) {
                    $this->app->call([$provider, 'boot']);
                }
            }
        }
    }
1192297
public function registerConfiguredProviders()
    {
        $providers = $this['config']->get('app.providers', []);

        foreach ($providers as $provider) {
            $this->register(new $provider($this));
        }
    }
457007
function $onInit() {
        if (!ctrl.multiple && ctrl.model.length) {
            $scope.item = ctrl.model[0];
        }

        if (ctrl.options instanceof Array) {
            ctrl._options = ctrl.options;
        } else {
            ctrl.options(ctrl.searchTerms, function (options) {
                ctrl._options = options;
                if (options.length === 0) checkLater();
                $scope.$apply();
            });
        }

        if (ctrl.search === undefined) {
            ctrl.search = true; // default true
        }
    }
264278
public function innerJoin($join, $on = null)
    {
        $this->getJoins()->innerJoin($join, $on);

        return $this;
    }
1370728
public function onRegister()
    {
        try {
            if (!$this->canRegister()) {
                throw new ApplicationException(Lang::get(/*Registrations are currently disabled.*/'rainlab.user::lang.account.registration_disabled'));
            }

            /*
             * Validate input
             */
            $data = post();

            if (!array_key_exists('password_confirmation', $data)) {
                $data['password_confirmation'] = post('password');
            }

            $rules = [
                'email'    => 'required|email|between:6,255',
                'password' => 'required|between:4,255|confirmed'
            ];

            if ($this->loginAttribute() == UserSettings::LOGIN_USERNAME) {
                $rules['username'] = 'required|between:2,255';
            }

            $validation = Validator::make($data, $rules);
            if ($validation->fails()) {
                throw new ValidationException($validation);
            }

            /*
             * Register user
             */
            Event::fire('rainlab.user.beforeRegister', [&$data]);

            $requireActivation = UserSettings::get('require_activation', true);
            $automaticActivation = UserSettings::get('activate_mode') == UserSettings::ACTIVATE_AUTO;
            $userActivation = UserSettings::get('activate_mode') == UserSettings::ACTIVATE_USER;
            $user = Auth::register($data, $automaticActivation);

            Event::fire('rainlab.user.register', [$user, $data]);

            /*
             * Activation is by the user, send the email
             */
            if ($userActivation) {
                $this->sendActivationEmail($user);

                Flash::success(Lang::get(/*An activation email has been sent to your email address.*/'rainlab.user::lang.account.activation_email_sent'));
            }

            /*
             * Automatically activated or not required, log the user in
             */
            if ($automaticActivation || !$requireActivation) {
                Auth::login($user);
            }

            /*
             * Redirect to the intended page after successful sign in
             */
            if ($redirect = $this->makeRedirection(true)) {
                return $redirect;
            }
        }
        catch (Exception $ex) {
            if (Request::ajax()) throw $ex;
            else Flash::error($ex->getMessage());
        }
    }
129622
public function registerProvider($key, LocationProviderInterface $provider)
    {
        if (!$this->hasProvider($key)) {
            $this->providers[$key] = $provider;
        }
    }
1303344
public function join($table, $on = null, $where = null, $binds = [])
    {
        if (!$on) {
            $this->join[] = $table;
        } else {
            $this->join[] = $table . (strpos($table, ' ON ') ? ' AND ' : ' ON ') . $on;
        }

        if ($where) {
            $this->where(new Raw($where));
        }

        if ($binds) {
            foreach ($binds as $bind) {
                $this->bind($bind, 'join');
            }
        }

        return $this;
    }
1029289
protected function registerDeferredServiceProvider($provider, ServiceProvider $instance): array
    {
        $deferred = [];

        foreach ($instance->provides() as $provide) {
            $deferred[$provide] = $provider;
        }

        return [
            'instance' => $instance,
            'eager'    => false,
            'when'     => $instance->when(),
            'deferred' => $deferred,
        ];
    }
236300
@Override
	public void registerOsgiProvider (Object provider) throws FhirConfigurationException {
		if (null == provider) {
			throw new NullPointerException("FHIR Provider cannot be null");
		}
		try {
			super.registerProvider(provider);
			log.trace("registered provider. class ["+provider.getClass().getName()+"]");
			this.serverProviders.add(provider);
		} catch (Exception e) {
			log.error("Error registering FHIR Provider", e);
			throw new FhirConfigurationException("Error registering FHIR Provider", e);
		}
	}
386125
public function verifyPeer($on = true)
    {
        Argument::i()->test(1, 'bool'); //argument 1 must be a boolean

        $this->options[CURLOPT_SSL_VERIFYPEER] = $on;
        return $this;
    }
1293073
public function registerConfiguredProviders()
    {
        foreach ([
                     CacheProvider::class,
                     PartProvider::class,
                     SchedulingProvider::class,
                     ViewProvider::class,
                     EventProvider::class,
                     DatabaseProvider::class,
                     LogProvider::class,
                     HttpProvider::class,
                     SocketProvider::class,

                     ExtendProvider::class,
                 ] as $provider) {
            $this->register($provider);
        }
    }
944738
public function registerProviders()
	{
		$providers = $this['config']->get('app.providers');

		foreach ($providers as $provider) {
			$this->providers[$provider] = new $provider($this);
			$this->providers[$provider]->register();
		}
	}
1091981
public function registerDeferredProvider($provider, $service = null)
    {
        // Once the provider that provides the deferred service has been registered we
        // will remove it from our local list of the deferred services with related
        // providers so that this container does not try to resolve it out again.
        if ($service) {
            unset($this->deferredServices[$service]);
        }
        $this->registerProvider($instance = new $provider($this));
    }
391340
protected function registerConfiguredServiceProviders()
    {
        $providers = $this->collectConfiguredServiceProviders();

        foreach ($providers as $provider) {
            $this->app->register($provider);
        }

        return $this;
    }
849393
public function register()
    {
        $this->resolveDirectories();

        $this->tryRequireHelpers(self::ON_REGISTER);
        $this->tryRegisterProviders(self::ON_REGISTER);

        if (method_exists($this, $this->bootingMethod)) {
            $this->app->booting(function (Application $app) {
                $app->call([$this, $this->bootingMethod]);
            });
        }

        if (method_exists($this, $this->bootedMethod)) {
            $this->app->booted(function (Application $app) {
                $app->call([$this, $this->bootedMethod]);
            });
        }

        // Config
        $this->registerConfigFiles();

        // Middlewares
        if (!$this->app->runningInConsole()) {
            $router = $this->app->make('router');
            $kernel = $this->app->make('Illuminate\Contracts\Http\Kernel');

            foreach ($this->prependMiddleware as $middleware) {
                $kernel->prependMiddleware($middleware);
            }

            foreach ($this->middleware as $middleware) {
                $kernel->pushMiddleware($middleware);
            }

            foreach ($this->routeMiddleware as $key => $middleware) {
                $router->middleware($key, $middleware);
            }
        }

        // Container bindings and aliases
        foreach ($this->bindings as $binding => $class) {
            $this->app->bind($binding, $class);
        }

        foreach ($this->weaklings as $binding => $class) {
            $this->bindIf($binding, $class);
        }

        foreach (['share' => $this->share, 'shared' => $this->shared] as $type => $bindings) {
            foreach ($bindings as $binding => $class) {
                $this->share($binding, $class, [], $type === 'shared');
            }
        }

        foreach ($this->singletons as $binding => $class) {
            if ($this->strict && !class_exists($class) && !interface_exists($class)) {
                throw new \Exception(get_called_class().": Could not find alias class [{$class}]. This exception is only thrown when \$strict checking is enabled");
            }
            $this->app->singleton($binding, $class);
        }

        foreach ($this->aliases as $alias => $full) {
            if ($this->strict && !class_exists($full) && !interface_exists($full)) {
                throw new \Exception(get_called_class().": Could not find alias class [{$full}]. This exception is only thrown when \$strict checking is enabled");
            }
            $this->app->alias($alias, $full);
        }

        // Commands
        if ($this->app->runningInConsole()) {
            foreach ($this->findCommands as $path) {
                $dir = path_get_directory((new ReflectionClass(get_called_class()))->getFileName());
                $classes = $this->findCommandsIn(path_join($dir, $path), $this->findCommandsRecursive);

                $this->commands = array_merge($this->commands, $classes);
            }
            if (is_array($this->commands) && count($this->commands) > 0) {
                $commands = [];
                foreach ($this->commands as $k => $v) {
                    if (is_string($k)) {
                        $this->app[ $this->commandPrefix.$k ] = $this->app->share(function ($app) use ($k, $v) {
                            return $app->build($v);
                        });

                        $commands[] = $this->commandPrefix.$k;
                    } else {
                        $commands[] = $v;
                    }
                }
                $this->commands($commands);
            }
        }
        // Facades
        if (class_exists('Illuminate\Foundation\AliasLoader')) {
            \Illuminate\Foundation\AliasLoader::getInstance($this->facades)->register();
        }

        // Helpers
        $this->tryRequireHelpers(self::ON_REGISTERED);

        $this->tryRegisterProviders(self::ON_REGISTERED);

        return $this->app;
    }
1285299
public function registerServices(ServiceProviderInterface $serviceProvider)
    {
        $services = $serviceProvider->getServices();      
        foreach ($services as $id => $service) {
            if ($this->has($id) == false) {
                $this->set($id, $service);
            }
        }
    }
9461
private function loadView(bool $try = false) : void
  {
    // configure view component
    Accessor::$viewsExtension = config('view.extension');
    Accessor::$viewsEngine    = config('view.engine');
    Accessor::$viewsCache     = config('app.dir') . config('view.compiled');
    Accessor::$viewsDirectory = config('app.dir') . config('view.views');

    // load component
    Accessor::requireView();
  }