Esempio n. 1
0
 public function start()
 {
     if ($this->isStarted()) {
         throw new \LogicException(sprintf('%s: cannot start an already started session!', __CLASS__), 1327397142);
     }
     $this->phpWrapper->session_start();
     NETHGUI_DEBUG && $this->getLog()->notice(sprintf('%s: session_start()', __CLASS__));
     $this->data = $this->phpWrapper->phpReadGlobalVariable('_SESSION', self::SESSION_NAME);
     if (is_null($this->data)) {
         $this->data = new \ArrayObject();
     } elseif (!$this->data instanceof \ArrayObject) {
         throw new \UnexpectedValueException(sprintf('%s: session data must be enclosed into an \\ArrayObject', __CLASS__), 1322738011);
     }
     return $this;
 }