Overview

Namespaces

  • Deimos
    • Session
      • Extensions
  • PHP

Classes

  • Deimos\Session\Extension
  • Deimos\Session\Session

Interfaces

  • Throwable

Traits

  • Deimos\Session\Extensions\Flash
  • Deimos\Session\Extensions\Variable

Exceptions

  • Exception
  • InvalidArgumentException
  • LogicException
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
 1: <?php
 2: 
 3: namespace Deimos\Session\Extensions;
 4: 
 5: trait Variable
 6: {
 7: 
 8:     /**
 9:      * @var array
10:      */
11:     private $object;
12: 
13:     /**
14:      * @var bool
15:      */
16:     private $init;
17: 
18:     /**
19:      * @return bool
20:      */
21:     private function init()
22:     {
23:         if (!$this->init)
24:         {
25:             global $_SESSION;
26: 
27:             $this->init = session_id() OR session_start();
28:             $this->object = &$_SESSION;
29:         }
30: 
31:         return !$this->init;
32:     }
33: 
34:     /**
35:      * @return array
36:      */
37:     protected function &object()
38:     {
39:         return $this->object;
40:     }
41: 
42: }
API documentation generated by ApiGen