From 065dd32f3168edc06ca235301c728ede8db849e6 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 6 Feb 2012 19:47:49 -0800 Subject: Add tags for all Cache::instance()->set calls that don't have one. Fixes #1818. --- modules/gallery/helpers/gallery_task.php | 6 ++++-- modules/gallery/helpers/item.php | 3 ++- modules/gallery/helpers/upgrade_checker.php | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'modules/gallery/helpers') diff --git a/modules/gallery/helpers/gallery_task.php b/modules/gallery/helpers/gallery_task.php index 4a97d865..4b477540 100644 --- a/modules/gallery/helpers/gallery_task.php +++ b/modules/gallery/helpers/gallery_task.php @@ -243,7 +243,8 @@ class gallery_task_Core { if (!$task->done) { Cache::instance()->set("update_l10n_cache:{$task->id}", - serialize(array($dirs, $files, $cache, $num_fetched))); + serialize(array($dirs, $files, $cache, $num_fetched)), + array("l10n")); } else { Cache::instance()->delete("update_l10n_cache:{$task->id}"); } @@ -293,7 +294,8 @@ class gallery_task_Core { $task->set("mode", "delete_files"); $task->set("current", 0); $task->set("total", count($files)); - Cache::instance()->set("file_cleanup_cache:{$task->id}", serialize($files)); + Cache::instance()->set("file_cleanup_cache:{$task->id}", serialize($files), + array("file_cleanup")); if (count($files) == 0) { break; } diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php index a0654a88..77d53663 100644 --- a/modules/gallery/helpers/item.php +++ b/modules/gallery/helpers/item.php @@ -408,7 +408,8 @@ class item_Core { */ static function set_display_context_callback() { $args = func_get_args(); - Cache::instance()->set("display_context_" . $sid = Session::instance()->id(), $args); + Cache::instance()->set("display_context_" . $sid = Session::instance()->id(), $args, + array("display_context")); } /** diff --git a/modules/gallery/helpers/upgrade_checker.php b/modules/gallery/helpers/upgrade_checker.php index c11a9319..66058e4f 100644 --- a/modules/gallery/helpers/upgrade_checker.php +++ b/modules/gallery/helpers/upgrade_checker.php @@ -72,7 +72,8 @@ class upgrade_checker_Core { $e->getLine(), $e->getTraceAsString())); } $result->timestamp = time(); - Cache::instance()->set("upgrade_checker_version_info", serialize($result), null, 86400 * 365); + Cache::instance()->set("upgrade_checker_version_info", serialize($result), + array("upgrade"), 86400 * 365); } /** -- cgit v1.2.3 From cdbd9b5a9dbaba0cd9e2a1204f5cc2a28b994737 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 6 Feb 2012 20:02:32 -0800 Subject: Don't support display contexts for robots. Fixes #1819. --- modules/gallery/helpers/item.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'modules/gallery/helpers') diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php index 77d53663..2b663f45 100644 --- a/modules/gallery/helpers/item.php +++ b/modules/gallery/helpers/item.php @@ -407,20 +407,26 @@ class item_Core { * Set the display context callback for any future item renders. */ static function set_display_context_callback() { - $args = func_get_args(); - Cache::instance()->set("display_context_" . $sid = Session::instance()->id(), $args, - array("display_context")); + if (!request::user_agent("robot")) { + $args = func_get_args(); + Cache::instance()->set("display_context_" . $sid = Session::instance()->id(), $args, + array("display_context")); + } } /** * Call the display context callback for the given item */ static function get_display_context($item) { - $args = Cache::instance()->get("display_context_" . $sid = Session::instance()->id()); - $callback = $args[0]; - $args[0] = $item; - if (!$callback) { + if (!request::user_agent("robot")) { + $args = Cache::instance()->get("display_context_" . $sid = Session::instance()->id()); + $callback = $args[0]; + $args[0] = $item; + } + + if (empty($callback)) { $callback = "Albums_Controller::get_display_context"; + $args = array($item); } return call_user_func_array($callback, $args); } -- cgit v1.2.3