Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 8 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 1 |
| LegacySessionUtils | |
0.00% |
0 / 8 |
|
0.00% |
0 / 5 |
30 | |
0.00% |
0 / 1 |
| hasSessionAttribute | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getSessionAttribute | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setSessionAttribute | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| removeSessionAttribute | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| clearSession | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2019 (original work) Open Assessment Technologies SA; |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | namespace oat\tao\helpers; |
| 23 | |
| 24 | use PHPSession; |
| 25 | |
| 26 | trait LegacySessionUtils |
| 27 | { |
| 28 | public function hasSessionAttribute($name) |
| 29 | { |
| 30 | return PHPSession::singleton()->hasAttribute($name); |
| 31 | } |
| 32 | |
| 33 | public function getSessionAttribute($name) |
| 34 | { |
| 35 | return PHPSession::singleton()->getAttribute($name); |
| 36 | } |
| 37 | |
| 38 | public function setSessionAttribute($name, $value) |
| 39 | { |
| 40 | PHPSession::singleton()->setAttribute($name, $value); |
| 41 | return $this; |
| 42 | } |
| 43 | |
| 44 | public function removeSessionAttribute($name) |
| 45 | { |
| 46 | PHPSession::singleton()->removeAttribute($name); |
| 47 | return $this; |
| 48 | } |
| 49 | |
| 50 | public function clearSession($global = true) |
| 51 | { |
| 52 | PHPSession::singleton()->clear($global); |
| 53 | return $this; |
| 54 | } |
| 55 | } |