-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmsclasses.php
52 lines (42 loc) · 1.1 KB
/
cmsclasses.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php if (!defined('CLYDEPHP')) { header ('HTTP/1.1 404 Not Found'); exit(1); }
require_once 'cmsfunctions.php';
class DbSessionStore implements SessionStore {
public function open($savePath,$sessionName) {
return true;
}
public function close() {
return true;
}
public function read($id) {
$db = Database::getDatabase('sessions');
$db->lock();
$data = @array_shift($db->getRow($id,false));
$db->release();
if (!$data) {
return null;
}
return $data;
}
public function write($id,$sessData) {
$db = Database::getDatabase('sessions');
$db->lock();
$db->insertRow(array($id => array($sessData)));
$db->release();
return true;
}
public function destroy($id){
$db = Database::getDatabase('sessions');
$db->lock();
$db->deleteRow($id);
$db->release();
return true;
}
public function gc($maxLifeTime) {
EventManager::getInstance()->getEvent('sessionGC')->raise($maxLifeTime);
$db = Database::getDatabase('sessions');
$db->lock();
$db->refresh();
$db->release();
return true;
}
}