From e5ca759a8f681bd3aad05e2ce9d899c86d35cd27 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Wed, 13 Jul 2011 22:14:19 +0000 Subject: [PATCH] (bug 29558) Add config var to disable update.php. Did this by checking $wgMiserMode and bailing unless --iknowwhatimdoing --- RELEASE-NOTES-1.19 | 1 + maintenance/update.php | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 7345f7e61f..10332e6456 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -73,6 +73,7 @@ production. * (bug 15802) An easy way to look up messages: language qqx which returns the message keys. * (bug 29868) Add support for passing parameters to mw.msg in jquery.localize. +* (bug 29558) $wgMiserMode now disables update.php by default === Bug fixes in 1.19 === * (bug 28868) Show total pages in the subtitle of an image on the diff --git a/maintenance/update.php b/maintenance/update.php index ede6ebe4aa..ef60a77e04 100644 --- a/maintenance/update.php +++ b/maintenance/update.php @@ -43,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( 'iknowwhatimdoing', 'Override when $wgMiserMode disables this script' ); } function getDbType() { @@ -75,7 +76,13 @@ class UpdateMediaWiki extends Maintenance { } function execute() { - global $wgVersion, $wgTitle, $wgLang; + global $wgVersion, $wgTitle, $wgLang, $wgMiserMode; + + if( $wgMiserMode && !$this->hasOption( 'iknowwhatimdoing' ) ) { + $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 --iknowwhatimdoing", true ); + } $wgLang = Language::factory( 'en' ); $wgTitle = Title::newFromText( "MediaWiki database updater" ); -- 2.20.1