| 1 | <?php |
||
| 17 | abstract class Storage |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * Load a session from storage by a given ID. |
||
| 21 | * If no session is found for the id, null will be returned. |
||
| 22 | * |
||
| 23 | * @param string $key |
||
| 24 | * |
||
| 25 | * @return array|null |
||
| 26 | */ |
||
| 27 | abstract public function load($key); |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Save a given session to storage. |
||
| 31 | * |
||
| 32 | * @param array $session |
||
| 33 | * @param array $config |
||
| 34 | * @param bool $exists |
||
| 35 | * |
||
| 36 | * @return void |
||
| 37 | */ |
||
| 38 | abstract public function save($session, $config, $exists); |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Delete a session from storage by a given ID. |
||
| 42 | * |
||
| 43 | * @param string $key |
||
| 44 | * |
||
| 45 | * @return void |
||
| 46 | */ |
||
| 47 | abstract public function delete($key); |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Create a fresh session array with a unique ID. |
||
| 51 | * |
||
| 52 | * @return array |
||
| 53 | */ |
||
| 54 | public function fresh() |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Get a new session ID that isn't assigned to any current session. |
||
| 61 | * |
||
| 62 | * @return string |
||
| 63 | */ |
||
| 64 | public function id() |
||
| 78 | } |
||
| 79 |