| 1 | <?php |
||
| 8 | class SessionAdapter implements AdapterInterface |
||
| 9 | { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @var array |
||
| 13 | */ |
||
| 14 | protected $session; |
||
| 15 | |||
| 16 | 2 | public function __construct() |
|
| 17 | { |
||
| 18 | 2 | if (!isset($_SESSION["__" . __CLASS__])) { |
|
| 19 | 1 | $_SESSION["__" . __CLASS__] = []; |
|
| 20 | } |
||
| 21 | |||
| 22 | 2 | $this->session = &$_SESSION["__" . __CLASS__]; |
|
| 23 | 2 | } |
|
| 24 | |||
| 25 | /** |
||
| 26 | * @inheritdoc |
||
| 27 | */ |
||
| 28 | 2 | public function set($name, $object) |
|
| 32 | |||
| 33 | /** |
||
| 34 | * @inheritdoc |
||
| 35 | */ |
||
| 36 | 3 | public function has($name) |
|
| 40 | |||
| 41 | /** |
||
| 42 | * @inheritdoc |
||
| 43 | */ |
||
| 44 | 2 | public function get($name) |
|
| 48 | } |
||
| 49 |