1 | <?php |
||
6 | class CCache |
||
7 | { |
||
8 | /** |
||
9 | * Path to the cache directory. |
||
10 | */ |
||
11 | private $path; |
||
12 | |||
13 | |||
14 | |||
15 | /** |
||
16 | * Set the path to the cache dir which must exist. |
||
17 | * |
||
18 | * @param string path to the cache dir. |
||
19 | * |
||
20 | * @throws Exception when $path is not a directory. |
||
21 | * |
||
22 | * @return $this |
||
23 | */ |
||
24 | public function setDir($path) |
||
34 | |||
35 | |||
36 | |||
37 | /** |
||
38 | * Get the path to the cache subdir and try to create it if its not there. |
||
39 | * |
||
40 | * @param string $subdir name of subdir |
||
41 | * @param array $create default is to try to create the subdir |
||
42 | * |
||
43 | * @return string | boolean as real path to the subdir or |
||
44 | * false if it does not exists |
||
45 | */ |
||
46 | public function getPathToSubdir($subdir, $create = true) |
||
64 | |||
65 | |||
66 | |||
67 | /** |
||
68 | * Get status of the cache subdir. |
||
69 | * |
||
70 | * @param string $subdir name of subdir |
||
71 | * |
||
72 | * @return string with status |
||
73 | */ |
||
74 | public function getStatusOfSubdir($subdir) |
||
87 | |||
88 | |||
89 | |||
90 | /** |
||
91 | * Remove the cache subdir. |
||
92 | * |
||
93 | * @param string $subdir name of subdir |
||
94 | * |
||
95 | * @return null | boolean true if success else false, null if no operation |
||
96 | */ |
||
97 | public function removeSubdir($subdir) |
||
107 | } |
||
108 |