summaryrefslogtreecommitdiff
path: root/modules/gallery/libraries
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2010-02-21 23:48:23 -0800
committerAndy Staudacher <andy.st@gmail.com>2010-02-21 23:48:23 -0800
commit6591ea25771f2ab31fea4bf3b7a6fd76c586e098 (patch)
treee1e9d3bf6c46465785bb40900c3eead6f0addc27 /modules/gallery/libraries
parent8e7eda9cc62c64e77fffabacae7441f8ea076c9d (diff)
Fix delete() function of DB based Cache driver. It expected a scalar key / tag value, but it was always an array of keys / tags.
(compare to system/libraries/Cache.php and the File.php driver)
Diffstat (limited to 'modules/gallery/libraries')
-rw-r--r--modules/gallery/libraries/drivers/Cache/Database.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/gallery/libraries/drivers/Cache/Database.php b/modules/gallery/libraries/drivers/Cache/Database.php
index 82a09ab9..085c5c35 100644
--- a/modules/gallery/libraries/drivers/Cache/Database.php
+++ b/modules/gallery/libraries/drivers/Cache/Database.php
@@ -153,15 +153,17 @@ class Cache_Database_Driver extends Cache_Driver {
* @param bool delete a tag
* @return bool
*/
- public function delete($id, $tag=false) {
+ public function delete($keys, $is_tag=false) {
$db = db::build()
->delete("caches");
- if ($id === true) {
+ if ($keys === true) {
// Delete all caches
- } else if ($tag === true) {
- $db->where("tags", "LIKE", "%<$id>%");
+ } else if ($is_tag === true) {
+ foreach ($keys as $tag) {
+ $db->where("tags", "LIKE", "%<$tag>%");
+ }
} else {
- $db->where("key", "=", $id);
+ $db->where("key", "IN", $keys);
}
$status = $db->execute();