1 | <?php namespace CMPayments\Cache; |
||
12 | class Cache |
||
13 | { |
||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | private $options = []; |
||
18 | |||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | private $passthru = []; |
||
23 | |||
24 | /** |
||
25 | * Cache constructor. |
||
26 | * |
||
27 | * @param array $options |
||
28 | * @param array $passthru |
||
29 | */ |
||
30 | public function __construct(array $options = [], &$passthru = []) |
||
41 | |||
42 | /** |
||
43 | * @return array |
||
44 | */ |
||
45 | public function getOptions() |
||
49 | |||
50 | /** |
||
51 | * Get the cache directory |
||
52 | * |
||
53 | * @return string |
||
54 | */ |
||
55 | public function getDirectory() |
||
59 | |||
60 | /** |
||
61 | * Get the cache filename |
||
62 | * |
||
63 | * @return string|null |
||
64 | */ |
||
65 | public function getFilename() |
||
69 | |||
70 | /** |
||
71 | * Set the cache filename |
||
72 | * |
||
73 | * @param string $filename |
||
74 | */ |
||
75 | public function setFilename($filename) |
||
79 | |||
80 | /** |
||
81 | * Get the debug option (boolean) |
||
82 | * |
||
83 | * @return boolean |
||
84 | */ |
||
85 | public function getDebug() |
||
89 | |||
90 | /** |
||
91 | * Returns the full path of the filename |
||
92 | * |
||
93 | * @return string |
||
94 | * @throws CacheException |
||
95 | */ |
||
96 | public function getAbsoluteFilePath() |
||
106 | |||
107 | /** |
||
108 | * Store Cache content |
||
109 | * |
||
110 | * @param $data |
||
111 | * @param null|string $filename |
||
112 | * |
||
113 | * @throws CacheException |
||
114 | */ |
||
115 | public function putContent($data, $filename = null) |
||
128 | |||
129 | /** |
||
130 | * Get Cache content |
||
131 | * |
||
132 | * @param $location |
||
133 | * |
||
134 | * @return mixed|null |
||
135 | */ |
||
136 | public function getContent($location) |
||
145 | |||
146 | /** |
||
147 | * Create runnable cache for $variable |
||
148 | * |
||
149 | * @param $variable |
||
150 | * @param bool|false $recursion |
||
151 | * |
||
152 | * @return string |
||
153 | * |
||
154 | * @author Bas Peters <[email protected]> |
||
155 | */ |
||
156 | private function generateRunnableCache($variable, $recursion = false) |
||
180 | } |
||
181 |