1 | <?php |
||
10 | class File implements StorageInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var string path to the config file |
||
14 | */ |
||
15 | protected $filename; |
||
16 | |||
17 | /** |
||
18 | * @var string The state of the file as an md5 checksum |
||
19 | * This is used to verify if the state of the file changed before it |
||
20 | * is written back |
||
21 | */ |
||
22 | private $fileState; |
||
23 | |||
24 | /** |
||
25 | * constructor |
||
26 | * |
||
27 | * @param string $file the file to persist the data two |
||
28 | */ |
||
29 | public function __construct($file) |
||
33 | |||
34 | /** |
||
35 | * @inheritdoc |
||
36 | */ |
||
37 | public function save($key, $value) |
||
56 | |||
57 | /** |
||
58 | * @inheritdoc |
||
59 | */ |
||
60 | public function load() |
||
68 | |||
69 | /** |
||
70 | * @inheritdoc |
||
71 | */ |
||
72 | public function clear() |
||
78 | |||
79 | /** |
||
80 | * Remove the requested key from the data, reguardless if it's a single |
||
81 | * value or an array of values |
||
82 | * |
||
83 | * @param array $data [description] |
||
84 | * @param string $key the key to delete |
||
85 | * @return array |
||
86 | */ |
||
87 | private function delKey(array $data, $key) |
||
96 | } |
||
97 |