r15517 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r15516‎ | r15517 | r15518 >
Date:00:43, 11 July 2006
Author:robchurch
Status:old
Tags:
Comment:
* Update the archive table unless $wgRenameUserQuick is set; defaults to the value of $wgMiserMode
* Note that it requires 1.7.0+ due to incompatible changes somewhere along the line
* Fix spelling error
Modified paths:
  • /trunk/extensions/Renameuser/SpecialRenameuser.php (modified) (history)
  • /trunk/extensions/Renameuser/SpecialRenameuser_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Renameuser/SpecialRenameuser_body.php
@@ -23,8 +23,8 @@
2424 return;
2525 }
2626
27 - if ( version_compare( $wgVersion, '1.5beta2', '<' ) ) {
28 - $wgOut->versionRequired( '1.5beta2' );
 27+ if ( version_compare( $wgVersion, '1.7.0', '<' ) ) {
 28+ $wgOut->versionRequired( '1.7.0' );
2929 return;
3030 }
3131
@@ -167,16 +167,17 @@
168168 // 1.5 schema
169169 'user' => 'user_name',
170170 'revision' => 'rev_user_text',
171 -
172 - // Badly indexed table, can be very slow, and who cares if it's wrong
173 - /*'archive' => 'ar_user_text',*/
174 -
175171 'image' => 'img_user_text',
176172 'oldimage' => 'oi_user_text',
177173
178174 // Very hot table, causes lag and deadlocks to update like this
179175 /*'recentchanges' => 'rc_user_text'*/
180176 );
 177+
 178+ global $wgRenameUserQuick;
 179+ if( !$wgRenameUserQuick )
 180+ $this->tables['archive'] = 'ar_user_text';
 181+
181182 }
182183
183184 /**
Index: trunk/extensions/Renameuser/SpecialRenameuser.php
@@ -22,7 +22,7 @@
2323 'url' => 'http://meta.wikimedia.org/wiki/Renameuser'
2424 );
2525
26 -# Internationlization file
 26+# Internationalisation file
2727 require_once( 'SpecialRenameuser.i18n.php' );
2828
2929 /**
@@ -39,6 +39,13 @@
4040 $wgLogHeaders['renameuser'] = 'renameuserlogpagetext';
4141 $wgLogActions['renameuser/renameuser'] = 'renameuserlogentry';
4242
 43+/**
 44+ * If this is set to true, then the archive table (deleted revisions) will
 45+ * not be updated. Defaults to the value of $wgMiserMode, since if that's on,
 46+ * then it's probably desirable to have this switched on too.
 47+ */
 48+$wgRenameUserQuick = $wgMiserMode;
 49+
4350 # Register the special page
4451 if ( !function_exists( 'extAddSpecialPage' ) ) {
4552 require( dirname(__FILE__) . '/../ExtensionFunctions.php' );