本文整理汇总了PHP中Illuminate\Contracts\Foundation\Application::registerDeferredProvider方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::registerDeferredProvider方法的具体用法?PHP Application::registerDeferredProvider怎么用?PHP Application::registerDeferredProvider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Contracts\Foundation\Application
的用法示例。
在下文中一共展示了Application::registerDeferredProvider方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: launchServices
private function launchServices(array $services)
{
foreach ($services as $service) {
$this->loaded[] = $service;
$this->application->registerDeferredProvider($service);
}
return $this;
}
示例2: register
/**
* Registers the server in the container.
*
* @return \Illuminate\Foundation\Application
* @throws \Exception
*/
public function register()
{
// Auto register the support service provider
if (!get_class($this) == SupportServiceProvider::class) {
$this->app->register(SupportServiceProvider::class);
}
$this->viewsPath = Str::replace($this->viewsPath, '{resourcesPath}', $this->getResourcesPath());
$this->assetsPath = Str::replace($this->assetsPath, '{resourcesPath}', $this->getResourcesPath());
$router = $this->app->make('router');
$kernel = $this->app->make('Illuminate\\Contracts\\Http\\Kernel');
$this->registerConfigFiles();
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);
}
foreach ($this->providers as $provider) {
$this->app->register($provider);
}
foreach ($this->deferredProviders as $provider) {
$this->app->registerDeferredProvider($provider);
}
foreach ($this->bindings as $binding => $class) {
$this->app->bind($binding, $class);
}
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);
}
if (is_array($this->commands) and count($this->commands) > 0) {
$this->commands($this->commands);
}
AliasLoader::getInstance($this->facades)->register();
$this->requireHelpersFor('register');
return $this->app;
}