1 | <?php |
||
11 | class QueueHistory implements HistoryInterface |
||
12 | { |
||
13 | protected $dir; |
||
14 | protected $filesystem; |
||
15 | protected $finder; |
||
16 | protected $data = []; |
||
17 | protected $length = 10; |
||
18 | |||
19 | /** |
||
20 | * Set the directory path where to store data |
||
21 | * |
||
22 | * @param string $dir |
||
23 | */ |
||
24 | 18 | public function setStoreDirectory($dir) |
|
28 | |||
29 | /** |
||
30 | * Set the filesystem |
||
31 | * |
||
32 | * @param Filesystem $fs |
||
33 | */ |
||
34 | 18 | public function setFilesystem(Filesystem $fs) |
|
38 | |||
39 | /** |
||
40 | * Set the file finder |
||
41 | * |
||
42 | * @param Finder $finder |
||
43 | */ |
||
44 | 18 | public function setFinder(Finder $finder) |
|
48 | |||
49 | /** |
||
50 | * Set the mex history length |
||
51 | * |
||
52 | * @param int $length |
||
53 | */ |
||
54 | 3 | public function setHistoryLength($length) |
|
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | 9 | public function put($key, array $value) |
|
72 | |||
73 | /** |
||
74 | * {@inheritdoc} |
||
75 | */ |
||
76 | 9 | public function get($key) |
|
106 | |||
107 | /** |
||
108 | * Build absolute path to the filename |
||
109 | * |
||
110 | * @param string $key |
||
111 | * |
||
112 | * @return string |
||
113 | */ |
||
114 | 9 | protected function getPath($key) |
|
122 | |||
123 | /** |
||
124 | * Transform any special character to an underscore |
||
125 | * |
||
126 | * @param string $text |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | 9 | protected function sanitize($text) |
|
134 | } |
||
135 |