From bf4c518bb56917b9960c67afe2893da4569a3938 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 16 Nov 2009 14:25:25 -0800 Subject: Store the directory, files and translation cache in the gallery3 cache instead of trying to store it in the task. It is possible with lots of modules and lots of incoming translations to go beyond the 64K limit in the task context. Possible fix for #886. --- modules/gallery/helpers/gallery_task.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'modules') diff --git a/modules/gallery/helpers/gallery_task.php b/modules/gallery/helpers/gallery_task.php index 95216cf0..e0b03682 100644 --- a/modules/gallery/helpers/gallery_task.php +++ b/modules/gallery/helpers/gallery_task.php @@ -120,15 +120,16 @@ class gallery_task_Core { $errors = array(); try { $start = microtime(true); - $dirs = $task->get("dirs"); - $files = $task->get("files"); - $cache = $task->get("cache", array()); + $data = Cache::instance()->get("update_l10n_cache:{$task->id}"); + if ($data) { + list($dirs, $files, $cache) = unserialize($data); + } $i = 0; switch ($task->get("mode", "init")) { case "init": // 0% $dirs = array("gallery", "modules", "themes", "installer"); - $files = array(); + $files = $cache = array(); $task->set("mode", "find_files"); $task->status = t("Finding files"); break; @@ -194,9 +195,12 @@ class gallery_task_Core { $task->percent_complete = 100; } - $task->set("files", $files); - $task->set("dirs", $dirs); - $task->set("cache", $cache); + if ($task->percent_complete < 100) { + Cache::instance()->set("update_l10n_cache:{$task->id}", + serialize(array($dirs, $files, $cache))); + } else { + Cache::instance()->delete("update_l10n_cache:{$task->id}"); + } } catch (Exception $e) { $task->done = true; $task->state = "error"; -- cgit v1.2.3