diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2009-11-16 14:57:35 -0800 | 
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2009-11-16 14:57:35 -0800 | 
| commit | ade642cff4a4ca810f468723b04efc6f229916d8 (patch) | |
| tree | 8fd9948212f4f28cc51e7d6e8c76b3cdd1388a87 /modules/gallery/helpers/gallery_task.php | |
| parent | 78b6da12aa08aad0fbae74bc03c1afddb609c150 (diff) | |
| parent | bf4c518bb56917b9960c67afe2893da4569a3938 (diff) | |
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers/gallery_task.php')
| -rw-r--r-- | modules/gallery/helpers/gallery_task.php | 18 | 
1 files changed, 11 insertions, 7 deletions
| 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"; | 
