summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/upgrader.php
diff options
context:
space:
mode:
authorChad Kieffer <ckieffer@gmail.com>2009-06-10 20:14:05 -0600
committerChad Kieffer <ckieffer@gmail.com>2009-06-10 20:14:05 -0600
commit6fbb2c4469730d962b807481f3898e5ffb544abf (patch)
tree94f25cdb3d8d0c5654036bada8ed520788b6f559 /modules/gallery/controllers/upgrader.php
parent9717c7cd83e62458b0dd20414d4814260a3dd57a (diff)
parent0c5cb026a72c3e894cbb7c6a637267f867cc323a (diff)
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/controllers/upgrader.php')
-rw-r--r--modules/gallery/controllers/upgrader.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/gallery/controllers/upgrader.php b/modules/gallery/controllers/upgrader.php
index 0d5bb4f6..0833e253 100644
--- a/modules/gallery/controllers/upgrader.php
+++ b/modules/gallery/controllers/upgrader.php
@@ -32,7 +32,11 @@ class Upgrader_Controller extends Controller {
public function upgrade() {
// Todo: give the admin a chance to log in here
- if (!user::active()->admin) {
+ if (php_sapi_name() == "cli") {
+ // @todo this may screw up some module installers, but we don't have a better answer at
+ // this time.
+ $_SERVER["HTTP_HOST"] = "example.com";
+ } else if (!user::active()->admin) {
access::forbidden();
}
@@ -51,6 +55,10 @@ class Upgrader_Controller extends Controller {
}
}
- url::redirect("upgrader?done=1");
+ if (php_sapi_name() == "cli") {
+ print "Upgrade complete\n";
+ } else {
+ url::redirect("upgrader?done=1");
+ }
}
}