summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Arthur <paul.arthur@flowerysong.com>2012-03-06 15:32:56 -0500
committerPaul Arthur <paul.arthur@flowerysong.com>2012-03-06 15:32:56 -0500
commit798318250390d983bc82df5efa37414da128e0ae (patch)
tree59bed0380594d792967f39edd1fa0b6c71265ef6
parent3525ad78cdb50fee2428fa5e6e31e114a2385417 (diff)
downloadampache-798318250390d983bc82df5efa37414da128e0ae.tar.gz
ampache-798318250390d983bc82df5efa37414da128e0ae.tar.bz2
ampache-798318250390d983bc82df5efa37414da128e0ae.zip
Use a flag to determine whether an outdated database is OK
This matches the handling of NO_SESSION and gives us some needed leeway for the CLI tools.
-rw-r--r--lib/init.php2
-rw-r--r--update.php3
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/init.php b/lib/init.php
index 0b8cd639..955a065b 100644
--- a/lib/init.php
+++ b/lib/init.php
@@ -280,7 +280,7 @@ unset($results);
flip_class(array('odd','even'));
/* Check to see if we need to perform an update */
-if (!preg_match('/update\.php/', $_SERVER['PHP_SELF'])) {
+if (!defined('OUTDATED_DATABASE_OK')) {
if (Update::need_update()) {
header("Location: " . Config::get('web_path') . "/update.php");
exit();
diff --git a/update.php b/update.php
index cc8d699a..1e582b56 100644
--- a/update.php
+++ b/update.php
@@ -27,7 +27,8 @@
*/
// We need this stuff
-define('NO_SESSION','1');
+define('NO_SESSION', 1);
+define('OUTDATED_DATABASE_OK', 1);
require 'lib/init.php';
// Get the version and format it