当前位置: 首页>>代码示例>>PHP>>正文


PHP SessionManager::driver方法代码示例

本文整理汇总了PHP中Illuminate\Session\SessionManager::driver方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionManager::driver方法的具体用法?PHP SessionManager::driver怎么用?PHP SessionManager::driver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Session\SessionManager的用法示例。


在下文中一共展示了SessionManager::driver方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: usingCookieSessions

 /**
  * Determine if the session is using cookie sessions.
  *
  * @return bool
  */
 protected function usingCookieSessions()
 {
     if (!$this->sessionConfigured()) {
         return false;
     }
     return $this->manager->driver()->getHandler() instanceof CookieSessionHandler;
 }
开发者ID:hramose,项目名称:Sistema-Control-de-Almacen,代码行数:12,代码来源:StartSession.php

示例2: getSession

 /**
  * @param RequestInterface $request
  * @return SessionInterface
  */
 private function getSession(RequestInterface $request)
 {
     $session = $this->manager->driver();
     $cookieData = FigRequestCookies::get($request, $session->getName());
     $session->setId($cookieData->getValue());
     return $session;
 }
开发者ID:nbsoftware,项目名称:laravel-session,代码行数:11,代码来源:Middleware.php

示例3: handleProviderCallback

 public function handleProviderCallback(Guard $auth, Socialite $socialite, UsersService $userService, SessionManager $manager)
 {
     $user = $socialite->driver('facebook')->user();
     $authUser = $userService->findOrCreateByFacebook($user);
     $auth->login($authUser);
     $manager->driver()->save();
     return redirect('/');
 }
开发者ID:rodnover55,项目名称:guess-rock,代码行数:8,代码来源:FacebookController.php

示例4: startSession

 public function startSession()
 {
     $encrypter = $this->createEncrypter();
     $manager = new SessionManager($this->laravel);
     $session = $manager->driver();
     $this->updateSessionId($encrypter, $session);
     $session->start();
     $this->bindNewSession($session);
 }
开发者ID:GBPcoder,项目名称:tpanel,代码行数:9,代码来源:laravelManager.php

示例5: getSession

 /**
  * getSession.
  *
  * @method getSession
  *
  * @param \Illuminate\Http\Request $request
  *
  * @return \Illuminate\Session\Store
  */
 protected function getSession($request)
 {
     $session = $this->sessionManager->driver();
     if ($session->isStarted() === false) {
         $session->setId($request->cookies->get($session->getName()));
         $session->setRequestOnHandler($request);
         $session->start();
     }
     return $session;
 }
开发者ID:recca0120,项目名称:laravel-payum,代码行数:19,代码来源:PayumService.php

示例6: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app['session'] = $this->app->share(function ($app) {
         // First, we will create the session manager which is responsible for the
         // creation of the various session drivers when they are needed by the
         // application instance, and will resolve them on a lazy load basis.
         $manager = new SessionManager($app);
         $driver = $manager->driver();
         $config = $app['config']['session'];
         // Once we get an instance of the session driver, we need to set a few of
         // the session options based on the application configuration, such as
         // the session lifetime and the sweeper lottery configuration value.
         $driver->setLifetime($config['lifetime']);
         $driver->setSweepLottery($config['lottery']);
         return $driver;
     });
 }
开发者ID:defra91,项目名称:levecchiecredenze.it,代码行数:22,代码来源:SessionServiceProvider.php

示例7: driver

 /**
  * Get a driver instance.
  *
  * @param string $driver
  * @return mixed 
  * @static 
  */
 public static function driver($driver = null)
 {
     //Method inherited from \Illuminate\Support\Manager
     return \Illuminate\Session\SessionManager::driver($driver);
 }
开发者ID:satriashp,项目名称:tour,代码行数:12,代码来源:_ide_helper.php

示例8: getSession

 /**
  * Get the session implementation from the manager.
  *
  * @param  \Symfony\Component\HttpFoundation\Request  $request
  * @return \Illuminate\Session\SessionInterface
  */
 public function getSession(Request $request)
 {
     $session = $this->manager->driver();
     $session->setId($request->cookies->get($session->getName()));
     return $session;
 }
开发者ID:visualturk,项目名称:framework,代码行数:12,代码来源:StartSession.php

示例9: array

// Not 100% sure on how many of these are needed
$container['config']['session.lifetime'] = 120;
// Minutes idleable
$container['config']['session.expire_on_close'] = false;
$container['config']['session.lottery'] = array(2, 100);
// lottery--how often do they sweep storage location to clear old ones?
$container['config']['session.cookie'] = 'laravel_session';
$container['config']['session.path'] = '/';
$container['config']['session.domain'] = null;
$container['config']['session.driver'] = 'file';
$container['config']['session.files'] = $path . '/sessions';
// Cookie time
$container['cookie'] = (new CookieJar())->setDefaultPathAndDomain('/', null);
// Now we need to fire up the session manager
$sessionManager = new SessionManager($container);
$container['session.store'] = $sessionManager->driver();
$container['session'] = $sessionManager;
// In order to maintain the session between requests, we need to populate the
// session ID from the supplied cookie
$cookieName = $container['session']->getName();
if (isset($_COOKIE[$cookieName])) {
    if ($sessionId = $_COOKIE[$cookieName]) {
        $container['session']->setId($sessionId);
    }
}
// Boot the session
$container['session']->start();
// END BOOTSTRAP---------------------------------------------------------------
// View
$app->get('/', function () use($container) {
    echo 'Current state of <code>$test</code>: ';
开发者ID:tunr,项目名称:IlluminateNonLaravel,代码行数:31,代码来源:index.php

示例10: __construct

 /**
  * __construct.
  *
  * @method __construct
  *
  * @param \Illuminate\Session\SessionManager $sessionManager
  */
 public function __construct(SessionManager $sessionManager)
 {
     $this->session = $sessionManager->driver();
 }
开发者ID:recca0120,项目名称:elfinder,代码行数:11,代码来源:Session.php

示例11: __construct

 public function __construct(SessionManager $session, array $processors = null)
 {
     $this->processors = $processors;
     $this->session = $session->driver();
 }
开发者ID:bmartel,项目名称:phperclip,代码行数:5,代码来源:ProcessManager.php

示例12: elfinder

 /**
  * elfinder.
  *
  * @param \Illuminate\Contracts\Routing\ResponseFactory $responseFactory
  * @param \Illuminate\Session\SessionManager            $sessionManager
  *
  * @return mixed
  */
 public function elfinder(ResponseFactory $responseFactory, SessionManager $sessionManager)
 {
     $token = $sessionManager->driver()->token();
     return $responseFactory->view('elfinder::elfinder', compact('token'));
 }
开发者ID:recca0120,项目名称:elfinder,代码行数:13,代码来源:ElfinderController.php

示例13: terminate

 /**
  * Perform any final actions for the request lifecycle.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Symfony\Component\HttpFoundation\Response  $response
  * @return void
  */
 public function terminate($request, $response)
 {
     if ($this->sessionHandled && $this->sessionConfigured() && !$this->usingCookieSessions()) {
         $this->manager->driver()->save();
     }
 }
开发者ID:betes-curieuses-design,项目名称:ElieJosiePhotographie,代码行数:13,代码来源:StartSession.php

示例14: getSession

 /**
  * Get the session implementation from the manager.
  *
  * @return \Illuminate\Session\SessionInterface
  */
 public function getSession()
 {
     return $this->manager->driver();
 }
开发者ID:devonzara,项目名称:framework,代码行数:9,代码来源:WriteSession.php

示例15: Config

Illuminate\Support\Facades\Facade::setFacadeApplication($app);
$app['app'] = $app;
$app['env'] = 'production';
$app['path'] = $basePath . '/app';
$app['path.lang'] = base_path('resources/lang');
$request = Illuminate\Http\Request::capture();
$app['request'] = $request;
/*load configure*/
$app['config'] = new Config(require base_path('config/config.php'));
/*end load configure*/
/*init new filesystem and register to container*/
$app['files'] = new Filesystem();
/*end init new filesystem and register to container*/
/*session manager*/
$sessionManager = new SessionManager($app);
$app['session.store'] = $sessionManager->driver();
$app['session'] = $sessionManager;
// In order to maintain the session between requests, we need to populate the
// session ID from the supplied cookie
$cookieName = $app['session']->getName();
if (isset($_COOKIE[$cookieName])) {
    if ($sessionId = $_COOKIE[$cookieName]) {
        $app['session']->setId($sessionId);
    }
}
// Boot the session
$app['session']->start();
/*end session manager*/
/*setup cookie*/
$cookie = new Cookie($app['session']->getName(), $app['session']->getId(), time() + $app['config']['session.lifetime'] * 60, '/', null, false);
setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain());
开发者ID:triasbrata,项目名称:webEnterprise,代码行数:31,代码来源:index.php


注:本文中的Illuminate\Session\SessionManager::driver方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。