r92109 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92108‎ | r92109 | r92110 >
Date:22:14, 13 July 2011
Author:demon
Status:ok (Comments)
Tags:
Comment:
(bug 29558) Add config var to disable update.php. Did this by checking $wgMiserMode and bailing unless --iknowwhatimdoing
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/maintenance/update.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/update.php
@@ -43,6 +43,7 @@
4444 $this->addOption( 'quick', 'Skip 5 second countdown before starting' );
4545 $this->addOption( 'doshared', 'Also update shared tables' );
4646 $this->addOption( 'nopurge', 'Do not purge the objectcache table after updates' );
 47+ $this->addOption( 'iknowwhatimdoing', 'Override when $wgMiserMode disables this script' );
4748 }
4849
4950 function getDbType() {
@@ -75,8 +76,14 @@
7677 }
7778
7879 function execute() {
79 - global $wgVersion, $wgTitle, $wgLang;
 80+ global $wgVersion, $wgTitle, $wgLang, $wgMiserMode;
8081
 82+ if( $wgMiserMode && !$this->hasOption( 'iknowwhatimdoing' ) ) {
 83+ $this->error( "Do not run update.php on this wiki. If you're seeing this you should\n"
 84+ . "probably ask for some help in performing your schema updates.\n\n"
 85+ . "If you know what you are doing, you can continue with --iknowwhatimdoing", true );
 86+ }
 87+
8188 $wgLang = Language::factory( 'en' );
8289 $wgTitle = Title::newFromText( "MediaWiki database updater" );
8390
Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -73,6 +73,7 @@
7474 * (bug 15802) An easy way to look up messages: language qqx which returns
7575 the message keys.
7676 * (bug 29868) Add support for passing parameters to mw.msg in jquery.localize.
 77+* (bug 29558) $wgMiserMode now disables update.php by default
7778
7879 === Bug fixes in 1.19 ===
7980 * (bug 28868) Show total pages in the subtitle of an image on the

Follow-up revisions

RevisionCommit summaryAuthorDate
r101867*grumble grumble* know it alls think I'm abusing $wgMiserMode. So fine, have ...demon20:15, 3 November 2011

Comments

#Comment by MZMcBride (talk | contribs)   05:47, 31 October 2011

I filed bug 32072 and bug 32073 as a result of this revision. I think this revision should be marked "fixme".

#Comment by Dantman (talk | contribs)   07:58, 31 October 2011

This is an abuse of miser mode to do something other than what miser mode is supposed to do. Just because someone is using miser mode does NOT mean that they are running multiple db servers or have some other reason running update.php would be problematic.

Either revert or use a new configuration var name.

#Comment by 😂 (talk | contribs)   14:24, 31 October 2011

I was going to introduce $wgImASuperBigWiki, but decided to reuse miser mode.

#Comment by MarkAHershberger (talk | contribs)   20:12, 3 November 2011

Aaron changed the parameter name, ^demon is updating the variable this relies on.

Status & tagging log