diff options
author | Nathan Kinkade <nath@nkinka.de> | 2012-02-21 16:26:59 +0000 |
---|---|---|
committer | Nathan Kinkade <nath@nkinka.de> | 2012-02-21 16:26:59 +0000 |
commit | 81020da574f1db9fd1315dd7149d11a00013ff29 (patch) | |
tree | 6ff5ee3e8b573eeeca8637ead318cedc3123834e | |
parent | c7b049780c40d7a4fb23a48c0c5651660a4caa58 (diff) | |
parent | b52fa3302670930077298d1df603740916f98055 (diff) |
Merge branch 'master' of git://github.com/gallery/gallery3
-rw-r--r-- | .build_number | 2 | ||||
-rw-r--r-- | modules/gallery/config/user_agents.php | 3 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_task.php | 6 | ||||
-rw-r--r-- | modules/gallery/helpers/item.php | 19 | ||||
-rw-r--r-- | modules/gallery/helpers/upgrade_checker.php | 3 |
5 files changed, 23 insertions, 10 deletions
diff --git a/.build_number b/.build_number index 420d11e7..b27a7618 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=185 +build_number=187 diff --git a/modules/gallery/config/user_agents.php b/modules/gallery/config/user_agents.php index 23877c66..7978bb62 100644 --- a/modules/gallery/config/user_agents.php +++ b/modules/gallery/config/user_agents.php @@ -20,3 +20,6 @@ include(SYSPATH . "config/user_agents.php"); $config["robot"]["mj12bot"] = "MJ12bot"; $config["robot"]["speedy spider"] = "Speedy Spider"; +$config["robot"]["baidu"] = "Baiduspider"; +$config["robot"]["bing"] = "Ezooms"; +$config["robot"]["yandex"] = "YandexBot"; 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..2b663f45 100644 --- a/modules/gallery/helpers/item.php +++ b/modules/gallery/helpers/item.php @@ -407,19 +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); + 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); } 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); } /** |