本文整理汇总了PHP中Illuminate\Foundation\Application::refresh方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::refresh方法的具体用法?PHP Application::refresh怎么用?PHP Application::refresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Foundation\Application
的用法示例。
在下文中一共展示了Application::refresh方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: viaRequest
/**
* Register a new callback based request guard.
*
* @param string $driver
* @param callable $callback
* @return $this
*/
public function viaRequest($driver, callable $callback)
{
return $this->extend($driver, function () use($callback) {
$guard = new RequestGuard($callback, $this->app['request']);
$this->app->refresh('request', $guard, 'setRequest');
return $guard;
});
}
示例2: createSessionDriver
/**
* Create a session based authentication guard.
*
* @param string $name
* @param array $config
* @return \Illuminate\Auth\SessionGuard
*/
public function createSessionDriver($name, $config)
{
$provider = $this->createUserProvider($config['source']);
$guard = new SessionGuard($name, $provider, $this->app['session.store']);
// When using the remember me functionality of the authentication services we
// will need to be set the encryption instance of the guard, which allows
// secure, encrypted cookie values to get generated for those cookies.
if (method_exists($guard, 'setCookieJar')) {
$guard->setCookieJar($this->app['cookie']);
}
if (method_exists($guard, 'setDispatcher')) {
$guard->setDispatcher($this->app['events']);
}
if (method_exists($guard, 'setRequest')) {
$guard->setRequest($this->app->refresh('request', $guard, 'setRequest'));
}
return $guard;
}
示例3: refresh
/**
* Refresh an instance on the given target and method.
*
* @param string $abstract
* @param mixed $target
* @param string $method
* @return mixed
* @static
*/
public static function refresh($abstract, $target, $method)
{
//Method inherited from \Illuminate\Container\Container
return \Illuminate\Foundation\Application::refresh($abstract, $target, $method);
}