summaryrefslogtreecommitdiff
path: root/maintenance/update.php
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/update.php')
-rw-r--r--maintenance/update.php26
1 files changed, 24 insertions, 2 deletions
diff --git a/maintenance/update.php b/maintenance/update.php
index e3941a3c..e4a594f6 100644
--- a/maintenance/update.php
+++ b/maintenance/update.php
@@ -5,6 +5,21 @@
* This is used when the database schema is modified and we need to apply patches.
* It is kept compatible with php 4 parsing so that it can give out a meaningful error.
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
* @file
* @todo document
* @ingroup Maintenance
@@ -28,6 +43,7 @@ class UpdateMediaWiki extends Maintenance {
$this->addOption( 'quick', 'Skip 5 second countdown before starting' );
$this->addOption( 'doshared', 'Also update shared tables' );
$this->addOption( 'nopurge', 'Do not purge the objectcache table after updates' );
+ $this->addOption( 'force', 'Override when $wgMiserMode disables this script' );
}
function getDbType() {
@@ -60,7 +76,13 @@ class UpdateMediaWiki extends Maintenance {
}
function execute() {
- global $wgVersion, $wgTitle, $wgLang;
+ global $wgVersion, $wgTitle, $wgLang, $wgMiserMode;
+
+ if( $wgMiserMode && !$this->hasOption( 'force' ) ) {
+ $this->error( "Do not run update.php on this wiki. If you're seeing this you should\n"
+ . "probably ask for some help in performing your schema updates.\n\n"
+ . "If you know what you are doing, you can continue with --force", true );
+ }
$wgLang = Language::factory( 'en' );
$wgTitle = Title::newFromText( "MediaWiki database updater" );
@@ -88,7 +110,7 @@ class UpdateMediaWiki extends Maintenance {
$shared = $this->hasOption( 'doshared' );
- $updates = array('core','extensions');
+ $updates = array( 'core', 'extensions', 'stats' );
if( !$this->hasOption('nopurge') ) {
$updates[] = 'purge';
}