[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/vendor/symfony/http-foundation/Session/Storage/Proxy/ -> SessionHandlerProxy.php (source)

   1  <?php
   2  
   3  /*
   4   * This file is part of the Symfony package.
   5   *
   6   * (c) Fabien Potencier <fabien@symfony.com>
   7   *
   8   * For the full copyright and license information, please view the LICENSE
   9   * file that was distributed with this source code.
  10   */
  11  
  12  namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy;
  13  
  14  /**
  15   * @author Drak <drak@zikula.org>
  16   */
  17  class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterface
  18  {
  19      protected $handler;
  20  
  21      /**
  22       * @param \SessionHandlerInterface $handler
  23       */
  24      public function __construct(\SessionHandlerInterface $handler)
  25      {
  26          $this->handler = $handler;
  27          $this->wrapper = ($handler instanceof \SessionHandler);
  28          $this->saveHandlerName = $this->wrapper ? ini_get('session.save_handler') : 'user';
  29      }
  30  
  31      // \SessionHandlerInterface
  32  
  33      /**
  34       * {@inheritdoc}
  35       */
  36      public function open($savePath, $sessionName)
  37      {
  38          $return = (bool) $this->handler->open($savePath, $sessionName);
  39  
  40          if (true === $return) {
  41              $this->active = true;
  42          }
  43  
  44          return $return;
  45      }
  46  
  47      /**
  48       * {@inheritdoc}
  49       */
  50      public function close()
  51      {
  52          $this->active = false;
  53  
  54          return (bool) $this->handler->close();
  55      }
  56  
  57      /**
  58       * {@inheritdoc}
  59       */
  60      public function read($sessionId)
  61      {
  62          return (string) $this->handler->read($sessionId);
  63      }
  64  
  65      /**
  66       * {@inheritdoc}
  67       */
  68      public function write($sessionId, $data)
  69      {
  70          return (bool) $this->handler->write($sessionId, $data);
  71      }
  72  
  73      /**
  74       * {@inheritdoc}
  75       */
  76      public function destroy($sessionId)
  77      {
  78          return (bool) $this->handler->destroy($sessionId);
  79      }
  80  
  81      /**
  82       * {@inheritdoc}
  83       */
  84      public function gc($maxlifetime)
  85      {
  86          return (bool) $this->handler->gc($maxlifetime);
  87      }
  88  }


Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1