summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/helpers/gallery_installer.php9
-rw-r--r--modules/gallery/libraries/drivers/Cache/Database.php5
-rw-r--r--modules/gallery/module.info2
3 files changed, 10 insertions, 6 deletions
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php
index 92fc662d..8ccbd51b 100644
--- a/modules/gallery/helpers/gallery_installer.php
+++ b/modules/gallery/helpers/gallery_installer.php
@@ -185,7 +185,7 @@ class gallery_installer {
`id` varchar(255) NOT NULL,
`tags` varchar(255),
`expiration` int(9) NOT NULL,
- `cache` text,
+ `cache` longblob,
PRIMARY KEY (`id`),
KEY (`tags`))
ENGINE=InnoDB DEFAULT CHARSET=utf8;");
@@ -258,7 +258,7 @@ class gallery_installer {
module::set_var("gallery", "show_credits", 1);
// @todo this string needs to be picked up by l10n_scanner
module::set_var("gallery", "credits", "Powered by <a href=\"%url\">Gallery %version</a>");
- module::set_version("gallery", 4);
+ module::set_version("gallery", 5);
}
static function upgrade($version) {
@@ -287,6 +287,11 @@ class gallery_installer {
ENGINE=InnoDB DEFAULT CHARSET=utf8;");
module::set_version("gallery", $version = 4);
}
+ if ($version == 4) {
+ Cache::instance()->delete_all();
+ $db->query("ALTER TABLE {caches} modify column cache LONGBLOB");
+ module::set_version("gallery", $version = 5);
+ }
}
static function uninstall() {
diff --git a/modules/gallery/libraries/drivers/Cache/Database.php b/modules/gallery/libraries/drivers/Cache/Database.php
index 70235e05..158f7b3a 100644
--- a/modules/gallery/libraries/drivers/Cache/Database.php
+++ b/modules/gallery/libraries/drivers/Cache/Database.php
@@ -68,7 +68,6 @@ class Cache_Database_Driver implements Cache_Driver {
$lifetime += time();
}
- $data = serialize($data);
if ($this->exists($id)) {
$status = $this->db->update("caches",
array("tags" => $tags, "expiration" => $lifetime, "cache" => $data), array("id" => $id));
@@ -101,7 +100,7 @@ class Cache_Database_Driver implements Cache_Driver {
foreach ($db_result as $row) {
// Add each cache to the array
- $result[$row->id] = unserialize($row->cache);
+ $result[$row->id] = $row->cache;
}
// Turn notices back on
@@ -133,7 +132,7 @@ class Cache_Database_Driver implements Cache_Driver {
$ER = error_reporting(~E_NOTICE);
// Return the valid cache data
- $data = unserialize($cache->cache);
+ $data = $cache->cache;
// Turn notices back on
error_reporting($ER);
diff --git a/modules/gallery/module.info b/modules/gallery/module.info
index 1a44ce51..817fdddd 100644
--- a/modules/gallery/module.info
+++ b/modules/gallery/module.info
@@ -1,3 +1,3 @@
name = Gallery 3
description = Gallery core application
-version = 4
+version = 5