Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

AbstractProxy.php

Zuletzt modifiziert: 09.10.2024, 12:59 - Dateigröße: 2.96 KiB


001  <?php
002   
003  /*
004   * This file is part of the Symfony package.
005   *
006   * (c) Fabien Potencier <fabien@symfony.com>
007   *
008   * For the full copyright and license information, please view the LICENSE
009   * file that was distributed with this source code.
010   */
011   
012  namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy;
013   
014  /**
015   * AbstractProxy.
016   *
017   * @author Drak <drak@zikula.org>
018   */
019  abstract class AbstractProxy
020  {
021      /**
022       * Flag if handler wraps an internal PHP session handler (using \SessionHandler).
023       *
024       * @var bool
025       */
026      protected $wrapper = false;
027   
028      /**
029       * @var bool
030       */
031      protected $active = false;
032   
033      /**
034       * @var string
035       */
036      protected $saveHandlerName;
037   
038      /**
039       * Gets the session.save_handler name.
040       *
041       * @return string
042       */
043      public function getSaveHandlerName()
044      {
045          return $this->saveHandlerName;
046      }
047   
048      /**
049       * Is this proxy handler and instance of \SessionHandlerInterface.
050       *
051       * @return bool
052       */
053      public function isSessionHandlerInterface()
054      {
055          return ($this instanceof \SessionHandlerInterface);
056      }
057   
058      /**
059       * Returns true if this handler wraps an internal PHP session save handler using \SessionHandler.
060       *
061       * @return bool
062       */
063      public function isWrapper()
064      {
065          return $this->wrapper;
066      }
067   
068      /**
069       * Has a session started?
070       *
071       * @return bool
072       */
073      public function isActive()
074      {
075          if (version_compare(phpversion(), '5.4.0', '>=')) {
076              return $this->active = \PHP_SESSION_ACTIVE === session_status();
077          }
078   
079          return $this->active;
080      }
081   
082      /**
083       * Sets the active flag.
084       *
085       * Has no effect under PHP 5.4+ as status is detected
086       * automatically in isActive()
087       *
088       * @internal
089       *
090       * @param bool    $flag
091       *
092       * @throws \LogicException
093       */
094      public function setActive($flag)
095      {
096          if (version_compare(phpversion(), '5.4.0', '>=')) {
097              throw new \LogicException('This method is disabled in PHP 5.4.0+');
098          }
099   
100          $this->active = (bool) $flag;
101      }
102   
103      /**
104       * Gets the session ID.
105       *
106       * @return string
107       */
108      public function getId()
109      {
110          return session_id();
111      }
112   
113      /**
114       * Sets the session ID.
115       *
116       * @param string $id
117       *
118       * @throws \LogicException
119       */
120      public function setId($id)
121      {
122          if ($this->isActive()) {
123              throw new \LogicException('Cannot change the ID of an active session');
124          }
125   
126          session_id($id);
127      }
128   
129      /**
130       * Gets the session name.
131       *
132       * @return string
133       */
134      public function getName()
135      {
136          return session_name();
137      }
138   
139      /**
140       * Sets the session name.
141       *
142       * @param string $name
143       *
144       * @throws \LogicException
145       */
146      public function setName($name)
147      {
148          if ($this->isActive()) {
149              throw new \LogicException('Cannot change the name of an active session');
150          }
151   
152          session_name($name);
153      }
154  }
155