r87409 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87408‎ | r87409 | r87410 >
Date:16:22, 4 May 2011
Author:ashley
Status:deferred (Comments)
Tags:
Comment:
ProtectSite: $wgMessageCache is dead and addMessages() was removed in r81027...is there a better way of doing this?
Modified paths:
  • /trunk/extensions/ProtectSite/ProtectSite.body.php (modified) (history)
  • /trunk/extensions/ProtectSite/ProtectSite.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ProtectSite/ProtectSite.body.php
@@ -57,7 +57,7 @@
5858
5959 /* Constructor */
6060 function __construct( &$request ) {
61 - global $wgMessageCache, $wgMemc;
 61+ global $wgMemc;
6262
6363 if( !class_exists( 'BagOStuff' ) || !class_exists( 'MediaWikiBagOStuff' ) ) {
6464 global $IP;
@@ -68,28 +68,6 @@
6969 $this->mRequest =& $request;
7070 $this->persist_data = new MediaWikiBagOStuff();
7171
72 - /**
73 - * These are dynamically created here because they don't need to vary
74 - * from the common messages and they save on the total count.
75 - */
76 - $wgMessageCache->addMessages(
77 - array(
78 - 'protectsite-createaccount-0' => wfMsg( 'protectsite-allowall' ),
79 - 'protectsite-createaccount-1' => wfMsg( 'protectsite-allowusersysop' ),
80 - 'protectsite-createaccount-2' => wfMsg( 'protectsite-allowsysop' ),
81 - 'protectsite-createpage-0' => wfMsg( 'protectsite-allowall' ),
82 - 'protectsite-createpage-1' => wfMsg( 'protectsite-allowusersysop' ),
83 - 'protectsite-createpage-2' => wfMsg( 'protectsite-allowsysop' ),
84 - 'protectsite-edit-0' => wfMsg( 'protectsite-allowall' ),
85 - 'protectsite-edit-1' => wfMsg( 'protectsite-allowusersysop' ),
86 - 'protectsite-edit-2' => wfMsg( 'protectsite-allowsysop' ),
87 - 'protectsite-move-0' => wfMsg( 'protectsite-allowusersysop' ),
88 - 'protectsite-move-1' => wfMsg( 'protectsite-allowsysop' ),
89 - 'protectsite-upload-0' => wfMsg( 'protectsite-allowusersysop' ),
90 - 'protectsite-upload-1' => wfMsg( 'protectsite-allowsysop' )
91 - )
92 - );
93 -
9472 /* Get data into the value variable/array */
9573 $prot = $wgMemc->get( wfMemcKey( 'protectsite' ) );
9674 if( !$prot ) {
Index: trunk/extensions/ProtectSite/ProtectSite.i18n.php
@@ -32,6 +32,23 @@
3333 'protectsite-until' => 'Protected until: ',
3434 'protectsite-protect' => 'Protect',
3535 'protectsite-unprotect' => 'Unprotect',
 36+
 37+ /* epic message duplication... */
 38+ 'protectsite-createaccount-0' => 'All users',
 39+ 'protectsite-createaccount-1' => 'Registered users and sysops',
 40+ 'protectsite-createaccount-2' => 'Sysops only',
 41+ 'protectsite-createpage-0' => 'All users',
 42+ 'protectsite-createpage-1' => 'Registered users and sysops',
 43+ 'protectsite-createpage-2' => 'Sysops only',
 44+ 'protectsite-edit-0' => 'All users',
 45+ 'protectsite-edit-1' => 'Registered users and sysops',
 46+ 'protectsite-edit-2' => 'Sysops only',
 47+ 'protectsite-move-0' => 'Registered users and sysops',
 48+ 'protectsite-move-1' => 'Sysops only',
 49+ 'protectsite-upload-0' => 'Registered users and sysops',
 50+ 'protectsite-upload-1' => 'Sysops only',
 51+ /* end epic message duplication */
 52+
3653 'right-protectsite' => 'Limit actions that can be performed for some groups for a limited time',
3754 );
3855

Follow-up revisions

RevisionCommit summaryAuthorDate
r87475ProtectSite: change sysop -> administrator as per CR on r87409ashley00:59, 5 May 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r81027* Replaced $wgMessageCache by MessageCache::singleton(); since we only use on...ialex15:42, 26 January 2011

Comments

#Comment by Siebrand (talk | contribs)   23:10, 4 May 2011

The sysop role should be referred to as "administrator" in UI messages.

Status & tagging log