diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-06-09 21:26:37 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-06-09 21:26:37 -0700 |
commit | 2fd322deeaf6b6b3f880fe21bf78664870d630a3 (patch) | |
tree | 43b8dcecbc83260c18ec00df80db876dc2db7306 /modules/gallery/controllers/upgrader.php | |
parent | accce788d97d19663a4c39666de03a417b5837b6 (diff) |
ACtually implement the upgrader, and add a confirmation box when the
upgrade is complete.
Diffstat (limited to 'modules/gallery/controllers/upgrader.php')
-rw-r--r-- | modules/gallery/controllers/upgrader.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/gallery/controllers/upgrader.php b/modules/gallery/controllers/upgrader.php index e8798de5..b8769b27 100644 --- a/modules/gallery/controllers/upgrader.php +++ b/modules/gallery/controllers/upgrader.php @@ -20,6 +20,27 @@ class Upgrader_Controller extends Controller { public function index() { $view = new View("upgrader.html"); + $view->available = module::available(); + $view->done = Input::instance()->get("done"); print $view; } + + public function upgrade() { + // Upgrade gallery and user first + module::install("gallery"); + module::install("user"); + + // Then upgrade the rest + foreach (module::available() as $id => $module) { + if ($id == "gallery") { + continue; + } + + if ($module->active && $module->code_version != $module->version) { + module::install($id); + } + } + + url::redirect("upgrader?done=1"); + } } |