@@ 98-118 (lines=21) @@ | ||
95 | ||
96 | } |
|
97 | ||
98 | public function clear($namespace = null) { |
|
99 | ||
100 | $result = []; |
|
101 | ||
102 | if ( $namespace === null ) { |
|
103 | ||
104 | $file_list = glob($this->cache_folder."*.{cache,expire}", GLOB_BRACE); |
|
105 | ||
106 | } else { |
|
107 | ||
108 | $file_list = glob($this->cache_folder."*-$namespace.{cache,expire}", GLOB_BRACE); |
|
109 | ||
110 | } |
|
111 | ||
112 | if ( empty($file_list) ) return true; |
|
113 | ||
114 | foreach ( $file_list as $file ) $result[] = unlink($file); |
|
115 | ||
116 | return !in_array(false, $result); |
|
117 | ||
118 | } |
|
119 | ||
120 | // public function getMultiple(array $keys, $namespace) { |
|
121 | // |
@@ 99-119 (lines=21) @@ | ||
96 | ||
97 | } |
|
98 | ||
99 | public function clear($namespace = null) { |
|
100 | ||
101 | $result = []; |
|
102 | ||
103 | if ( $namespace === null ) { |
|
104 | ||
105 | $file_list = glob($this->cache_folder."*.cache"); |
|
106 | ||
107 | } else { |
|
108 | ||
109 | $file_list = glob($this->cache_folder."*-$namespace.cache"); |
|
110 | ||
111 | } |
|
112 | ||
113 | if ( empty($file_list) ) return true; |
|
114 | ||
115 | foreach ( $file_list as $file ) $result[] = unlink($file); |
|
116 | ||
117 | return !in_array(false, $result); |
|
118 | ||
119 | } |
|
120 | ||
121 | public function getMultiple(array $keys, $namespace) { |
|
122 |