3 namespace app\Github\Storage
;
5 use app\Github\Storage
;
7 class Session
implements Storage
11 function __construct($ns = "github") {
15 function set($key, Item
$item) {
16 $_SESSION[$this->ns
][$key] = $item;
20 function get($key, Item
&$item = null, $update = false) {
21 if (!isset($_SESSION[$this->ns
][$key])) {
24 $item = $_SESSION[$this->ns
][$key];
25 if (null === $item->getTTL()) {
28 if ($item->getLTL() >= 0) {
30 $item->setTimestamp();
38 unset($_SESSION[$this->ns
][$key]);