r87487 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87486‎ | r87487 | r87488 >
Date:06:29, 5 May 2011
Author:demon
Status:ok (Comments)
Tags:
Comment:
Kill $wgSkinExtensionFunctions. Way back in r4934 when it was introduced, it was near the beginning of Setup.php, and $wgExtensionFunctions was near the end. Thus, they served two different purposes for doing extension setup. Refactoring over time has brought these processes side-by-side and thus the unused (and less-featured) one is getting the axe.

-1 more awful global \o/
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/Setup.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialVersion.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Setup.php
@@ -434,13 +434,6 @@
435435 wfProfileOut( $fname . '-globals' );
436436 wfProfileIn( $fname . '-extensions' );
437437
438 -# Skin setup functions
439 -# Entries can be added to this variable during the inclusion
440 -# of the extension file. Skins can then perform any necessary initialisation.
441 -foreach ( $wgSkinExtensionFunctions as $func ) {
442 - call_user_func( $func );
443 -}
444 -
445438 # Extension setup functions for extensions other than skins
446439 # Entries should be added to this variable during the inclusion
447440 # of the extension file. This allows the extension to perform
Index: trunk/phase3/includes/DefaultSettings.php
@@ -4526,12 +4526,6 @@
45274527 $wgExtensionFunctions = array();
45284528
45294529 /**
4530 - * Extension functions for initialisation of skins. This is called somewhat earlier
4531 - * than $wgExtensionFunctions.
4532 - */
4533 -$wgSkinExtensionFunctions = array();
4534 -
4535 -/**
45364530 * Extension messages files.
45374531 *
45384532 * Associative array mapping extension name to the filename where messages can be
Index: trunk/phase3/includes/specials/SpecialVersion.php
@@ -261,9 +261,9 @@
262262 * @return String: Wikitext
263263 */
264264 function getExtensionCredits() {
265 - global $wgExtensionCredits, $wgExtensionFunctions, $wgParser, $wgSkinExtensionFunctions;
 265+ global $wgExtensionCredits, $wgExtensionFunctions, $wgParser;
266266
267 - if ( !count( $wgExtensionCredits ) && !count( $wgExtensionFunctions ) && !count( $wgSkinExtensionFunctions ) ) {
 267+ if ( !count( $wgExtensionCredits ) && !count( $wgExtensionFunctions ) ) {
268268 return '';
269269 }
270270
@@ -321,11 +321,6 @@
322322 $out .= '<tr><td colspan="4">' . $this->listToText( $fhooks ) . "</td></tr>\n";
323323 }
324324
325 - if ( count( $wgSkinExtensionFunctions ) ) {
326 - $out .= $this->openExtType( wfMsg( 'version-skin-extension-functions' ), 'skin-extension-functions' );
327 - $out .= '<tr><td colspan="4">' . $this->listToText( $wgSkinExtensionFunctions ) . "</td></tr>\n";
328 - }
329 -
330325 $out .= Xml::closeElement( 'table' );
331326
332327 return $out;
Index: trunk/phase3/RELEASE-NOTES
@@ -60,6 +60,7 @@
6161 * $wgProfiling has been removed.
6262 * The spyc library is now no longer included in phase3.
6363 * (bug 28343) Unused preferences contextlines/contextchars have been removed
 64+* $wgSkinExtensionFunctions has been removed. Use $wgExtensionFunctions instead.
6465
6566 === New features in 1.18 ===
6667 * (bug 8130) Query pages should limit to content namespaces, not just main

Follow-up revisions

RevisionCommit summaryAuthorDate
r87503Followup r87487: drop unused messagedemon18:55, 5 May 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r4934ENH#169: Provide plugin interface for skins. See also module "sampleskin" in ...jeluf05:23, 27 August 2004

Comments

#Comment by IAlex (talk | contribs)   10:02, 5 May 2011

You can close bug 26894 ;)

#Comment by Jack Phoenix (talk | contribs)   13:08, 5 May 2011

I assume that 'version-skin-extension-functions' interface message is now unused, too, so it probably should be removed.

#Comment by 😂 (talk | contribs)   18:54, 5 May 2011

Yep, see followup.

Status & tagging log