1 | <?php |
||
12 | class DatabaseStore extends BaseStore |
||
13 | { |
||
14 | |||
15 | /** |
||
16 | * Determine if the DB is ready to use. |
||
17 | * |
||
18 | * @return bool |
||
19 | * @throws Exception |
||
20 | */ |
||
21 | protected function isDatabaseReady() |
||
36 | |||
37 | public function open($save_path, $name) |
||
41 | |||
42 | public function close() |
||
46 | |||
47 | public function read($session_id) |
||
68 | |||
69 | public function write($session_id, $session_data) |
||
88 | |||
89 | public function destroy($session_id) |
||
93 | |||
94 | public function gc($maxlifetime) |
||
105 | |||
106 | /** |
||
107 | * Encode binary data into ASCII string (a subset of UTF-8) |
||
108 | * |
||
109 | * Silverstripe <= 4.4 does not have a binary db field implementation, so we have to store |
||
110 | * binary data as text |
||
111 | * |
||
112 | * @param string $data This is a binary blob |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | private function binaryDataJsonEncode($data) |
||
123 | |||
124 | /** |
||
125 | * Decode ASCII string into original binary data (a php string) |
||
126 | * |
||
127 | * Silverstripe <= 4.4 does not have a binary db field implementation, so we have to store |
||
128 | * binary data as text |
||
129 | * |
||
130 | * @param string $text |
||
131 | * |
||
132 | * @param null|string |
||
133 | */ |
||
134 | private function binaryDataJsonDecode($text) |
||
148 | } |
||
149 |