@@ 89-98 (lines=10) @@ | ||
86 | // add all the tags to the index key. |
|
87 | // TODO: $this->getIndex($key)->add($tags); |
|
88 | ||
89 | foreach ($tags as $tag) { |
|
90 | $tag = $this->mapTag($tag); |
|
91 | $keys = apc_fetch($tag, $success); |
|
92 | if (false === $success) { |
|
93 | $store[$tag] = array($key); |
|
94 | } else { |
|
95 | $keys[] = $key; |
|
96 | $store[$tag] = array_unique($keys); |
|
97 | } |
|
98 | } |
|
99 | } |
|
100 | ||
101 | return !in_array(false, apc_store($store, null, $ttl)); |
|
@@ 143-154 (lines=12) @@ | ||
140 | public function clean(array $tags) |
|
141 | { |
|
142 | $rmed = array(); |
|
143 | foreach ($tags as $tag) { |
|
144 | $tag = $this->mapTag($tag); |
|
145 | $keys = apc_fetch($tag, $success); |
|
146 | if ($success) { |
|
147 | foreach ($keys as $key) { |
|
148 | $rmed[] = apc_delete($key); |
|
149 | } |
|
150 | $rmed[] = apc_delete($tag); |
|
151 | } else { |
|
152 | $rmed[] = false; |
|
153 | } |
|
154 | } |
|
155 | ||
156 | return !in_array(false, $rmed); |
|
157 | } |