diff options
author | Nathan Kinkade <nkinkade@nkinka.de> | 2010-02-27 14:03:01 +0000 |
---|---|---|
committer | Nathan Kinkade <nkinkade@nkinka.de> | 2010-02-27 14:03:01 +0000 |
commit | a58aa6e97b0e44adf7a878db6e276b081e202192 (patch) | |
tree | cecc68b1222cb283a021478b822952c468d64393 /modules/gallery/libraries/drivers/Cache/Database.php | |
parent | 10e36fcf1b5acf07c5cc128105af03fb09aac89e (diff) | |
parent | d9707ae749df2770370dc4eeeeaddda28f092d4d (diff) |
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/gallery/libraries/drivers/Cache/Database.php')
-rw-r--r-- | modules/gallery/libraries/drivers/Cache/Database.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/gallery/libraries/drivers/Cache/Database.php b/modules/gallery/libraries/drivers/Cache/Database.php index 82a09ab9..ff982396 100644 --- a/modules/gallery/libraries/drivers/Cache/Database.php +++ b/modules/gallery/libraries/drivers/Cache/Database.php @@ -130,7 +130,7 @@ class Cache_Database_Driver extends Cache_Driver { // Make sure the expiration is valid and that the hash matches if ($cache->expiration != 0 && $cache->expiration <= time()) { // Cache is not valid, delete it now - $this->delete($cache->id); + $this->delete(array($cache->id)); } else { // Disable notices for unserializing $ER = error_reporting(~E_NOTICE); @@ -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(); |