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() |
||
73 | |||
74 | /** |
||
75 | * @inheritdoc |
||
76 | */ |
||
77 | public function clear() |
||
83 | |||
84 | /** |
||
85 | * Remove the requested key from the data, reguardless if it's a single |
||
86 | * value or an array of values |
||
87 | * |
||
88 | * @param array $data [description] |
||
89 | * @param string $key the key to delete |
||
90 | * @return array |
||
91 | */ |
||
92 | private function delKey(array $data, $key) |
||
102 | } |
||
103 |