本文整理匯總了PHP中Illuminate\Foundation\Application::share方法的典型用法代碼示例。如果您正苦於以下問題:PHP Application::share方法的具體用法?PHP Application::share怎麽用?PHP Application::share使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Illuminate\Foundation\Application
的用法示例。
在下文中一共展示了Application::share方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: share
/**
* Wrap a Closure such that it is shared.
*
* @param \Closure $closure
* @return \Closure
* @static
*/
public static function share($closure)
{
//Method inherited from \Illuminate\Container\Container
return \Illuminate\Foundation\Application::share($closure);
}
示例2: createCryptProvider
/**
* Create crypt provider object.
*
* @return void
*/
protected function createCryptProvider()
{
$this->app["auth2.{$this->name}.crypt"] = $this->app->share(function ($app) {
return new BcryptHasher();
});
}
示例3: registerInternalCommand
/**
* Register the queue listener console command.
*
* @param \Illuminate\Foundation\Application $app
*
* @return void
*/
protected function registerInternalCommand($app)
{
$app['command.queue.internal'] = $app->share(function ($app) {
return new InternalCommand();
});
}
示例4: registerAsyncCommand
/**
* Register the queue listener console command.
*
* @param \Illuminate\Foundation\Application $app
*
* @return void
*/
protected function registerAsyncCommand($app)
{
$app['command.queue.async'] = $app->share(function ($app) {
return new AsyncCommand();
});
}