r108577 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108576‎ | r108577 | r108578 >
Date:00:38, 11 January 2012
Author:siebrand
Status:ok (Comments)
Tags:i18nreview, languagegetmagic 
Comment:
Remove use of deprecated LanguageGetMagic hook.
Modified paths:
  • /trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php (modified) (history)
  • /trunk/extensions/ApprovedRevs/ApprovedRevs.i18n.magic.php (added) (history)
  • /trunk/extensions/ApprovedRevs/ApprovedRevs.php (modified) (history)
  • /trunk/extensions/CSS/CSS.php (modified) (history)
  • /trunk/extensions/CategoryMultisort/CategoryMultisort.hooks.php (modified) (history)
  • /trunk/extensions/CategoryMultisort/CategoryMultisort.i18n.magic.php (added) (history)
  • /trunk/extensions/CategoryMultisort/CategoryMultisort.php (modified) (history)
  • /trunk/extensions/Comments/Comment.php (modified) (history)
  • /trunk/extensions/Comments/Comments.i18n.magic.php (added) (history)
  • /trunk/extensions/ContributionReporting/ContributionReporting.i18n.magic.php (added) (history)
  • /trunk/extensions/ContributionReporting/ContributionReporting.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CSS/CSS.php
@@ -25,6 +25,7 @@
2626 $wgCSSIdentifier = 'css-extension';
2727
2828 $wgHooks['ParserFirstCallInit'][] = 'wfCSSParserFirstCallInit';
 29+// FIXME: LanguageGetMagic is deprecated.
2930 $wgHooks['LanguageGetMagic'][] = 'wfCSSLanguageGetMagic';
3031 $wgHooks['RawPageViewBeforeOutput'][] = 'wfCSSRawPageViewBeforeOutput';
3132
Index: trunk/extensions/ContributionReporting/ContributionReporting.php
@@ -41,6 +41,7 @@
4242
4343 $wgExtensionMessagesFiles['ContributionReporting'] = $dir . 'ContributionReporting.i18n.php';
4444 $wgExtensionMessagesFiles['ContributionReportingAlias'] = $dir . 'ContributionReporting.alias.php';
 45+$wgExtensionMessagesFiles['ContributionReportingMagic'] = $dir . 'ContributionReporting.magic.php';
4546
4647 $wgAutoloadClasses['ContributionHistory'] = $dir . 'ContributionHistory_body.php';
4748 $wgAutoloadClasses['ContributionTotal'] = $dir . 'ContributionTotal_body.php';
@@ -144,7 +145,6 @@
145146 ) + $commonModuleInfo;
146147
147148 $wgHooks['ParserFirstCallInit'][] = 'efContributionReportingSetup';
148 -$wgHooks['LanguageGetMagic'][] = 'efContributionReportingTotal_Magic';
149149
150150 /**
151151 * @param $parser Parser
@@ -156,18 +156,6 @@
157157 }
158158
159159 /**
160 - * Define the contributiontotal magic word
161 - * Example: {{#contributiontotal:fundraiser=2011|fudgefactor=0}}
162 - * @param $magicWords array
163 - * @param $langCode string
164 - * @return bool
165 - */
166 -function efContributionReportingTotal_Magic( &$magicWords, $langCode ) {
167 - $magicWords['contributiontotal'] = array( 0, 'contributiontotal' );
168 - return true;
169 -}
170 -
171 -/**
172160 * Automatically use a local or special database connection for reporting
173161 * This connection will typically be to the CiviCRM master database
174162 * @return DatabaseMysql
Index: trunk/extensions/ContributionReporting/ContributionReporting.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'contributiontotal' => array( 0, 'contributiontotal' ),
 12+);
Property changes on: trunk/extensions/ContributionReporting/ContributionReporting.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/CategoryMultisort/CategoryMultisort.i18n.magic.php
@@ -0,0 +1,13 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'CategoryMultisort' => array( 0, 'CategoryMultisort' ),
 12+ 'CategoryDefaultMultisort' => array( 0, 'CategoryDefaultMultisort' ),
 13+ 'CategoryUseMultisort' => array( 0, 'CategoryUseMultisort' ),
 14+);
Property changes on: trunk/extensions/CategoryMultisort/CategoryMultisort.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
115 + native
Added: svn:keywords
216 + Id
Index: trunk/extensions/CategoryMultisort/CategoryMultisort.php
@@ -17,6 +17,7 @@
1818 $wgAutoloadClasses['CategoryMultisortViewer'] = $dir . 'CategoryMultisort.class.php';
1919
2020 $wgExtensionMessagesFiles['CategoryMultisort'] = $dir . 'CategoryMultisort.i18n.php';
 21+$wgExtensionMessagesFiles['CategoryMultisortMagic'] = $dir . 'CategoryMultisort.i18n.magic.php';
2122
2223 $wgCategoryMultisortHooks = new CategoryMultisortHooks();
2324
Index: trunk/extensions/CategoryMultisort/CategoryMultisort.hooks.php
@@ -12,7 +12,6 @@
1313 foreach ( array(
1414 'LoadExtensionSchemaUpdates',
1515 'ParserFirstCallInit',
16 - 'LanguageGetMagic',
1716 'ParserClearState',
1817 'ParserBeforeTidy',
1918 'LinksUpdate',
@@ -71,13 +70,6 @@
7271 return true;
7372 }
7473
75 - function onLanguageGetMagic( &$magicWords, $langCode ) {
76 - $magicWords['CategoryMultisort'] = array( 0, 'CategoryMultisort' );
77 - $magicWords['CategoryDefaultMultisort'] = array( 0, 'CategoryDefaultMultisort' );
78 - $magicWords['CategoryUseMultisort'] = array( 0, 'CategoryUseMultisort' );
79 - return true;
80 - }
81 -
8274 function onParserClearState( $parser ) {
8375 $parser->getOutput()->mCategoryMultisorts = array();
8476 $parser->getOutput()->mCategoryDefaultMultisorts = array();
Index: trunk/extensions/Comments/Comment.php
@@ -24,7 +24,7 @@
2525 // Extension credits that will show up on Special:Version
2626 $wgExtensionCredits['parserhook'][] = array(
2727 'name' => 'Comments',
28 - 'version' => '2.5',
 28+ 'version' => '2.6',
2929 'author' => array( 'David Pean', 'Misza', 'Jack Phoenix' ),
3030 'description' => 'Adds <tt>&lt;comments&gt;</tt> parser hook that allows commenting on articles',
3131 'url' => 'https://www.mediawiki.org/wiki/Extension:Comments'
@@ -61,6 +61,7 @@
6262 // Set up the new special pages
6363 $dir = dirname( __FILE__ ) . '/';
6464 $wgExtensionMessagesFiles['Comments'] = $dir . 'Comments.i18n.php';
 65+$wgExtensionMessagesFiles['CommentsMagic'] = $dir . 'Comments.i18n.magic.php';
6566 $wgAutoloadClasses['Comment'] = $dir . 'CommentClass.php';
6667 $wgAutoloadClasses['CommentIgnoreList'] = $dir . 'SpecialCommentIgnoreList.php';
6768 $wgAutoloadClasses['CommentListGet'] = $dir . 'CommentAction.php';
@@ -158,18 +159,6 @@
159160 return $output;
160161 }
161162
162 -// Translations for {{NUMBEROFCOMMENTS}}
163 -//$wgExtensionMessagesFiles['NumberOfComments'] = $dir . 'Comments.i18n.magic.php';
164 -
165 -$wgHooks['LanguageGetMagic'][] = 'wfNumberOfCommentsMagicWord';
166 -function wfNumberOfCommentsMagicWord( &$magicWords, $langID ) {
167 - // tell MediaWiki that {{NUMBEROFCOMMENTS}} and all case variants found in
168 - // wiki text should be mapped to magic ID 'NUMBEROFCOMMENTS'
169 - // (0 means case-insensitive)
170 - $magicWords['NUMBEROFCOMMENTS'] = array( 0, 'NUMBEROFCOMMENTS' );
171 - return true;
172 -}
173 -
174163 $wgHooks['ParserGetVariableValueSwitch'][] = 'wfNumberOfCommentsAssignValue';
175164 function wfNumberOfCommentsAssignValue( &$parser, &$cache, &$magicWordId, &$ret ) {
176165 global $wgMemc;
Index: trunk/extensions/Comments/Comments.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'NUMBEROFCOMMENTS' => array( 0, 'NUMBEROFCOMMENTS' ),
 12+);
Property changes on: trunk/extensions/Comments/Comments.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/ApprovedRevs/ApprovedRevs.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'MAG_APPROVEDREVS' => array( 0, '__APPROVEDREVS__' ),
 12+);
Property changes on: trunk/extensions/ApprovedRevs/ApprovedRevs.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/ApprovedRevs/ApprovedRevs.php
@@ -9,7 +9,7 @@
1010 * @author Yaron Koren
1111 */
1212
13 -define( 'APPROVED_REVS_VERSION', '0.6' );
 13+define( 'APPROVED_REVS_VERSION', '0.7' );
1414
1515 // credits
1616 $wgExtensionCredits['other'][] = array(
@@ -32,6 +32,7 @@
3333 // internationalization
3434 $wgExtensionMessagesFiles['ApprovedRevs'] = $egApprovedRevsIP . 'ApprovedRevs.i18n.php';
3535 $wgExtensionMessagesFiles['ApprovedRevsAlias'] = $egApprovedRevsIP . 'ApprovedRevs.alias.php';
 36+$wgExtensionMessagesFiles['ApprovedRevsMagic'] = $egApprovedRevsIP . 'ApprovedRevs.magic.php';
3637
3738 // register all classes
3839 $wgAutoloadClasses['ApprovedRevs'] = $egApprovedRevsIP . 'ApprovedRevs_body.php';
@@ -58,7 +59,6 @@
5960 $wgHooks['BeforeParserFetchTemplateAndtitle'][] = 'ApprovedRevsHooks::setTranscludedPageRev';
6061 $wgHooks['ArticleDeleteComplete'][] = 'ApprovedRevsHooks::deleteRevisionApproval';
6162 $wgHooks['MagicWordwgVariableIDs'][] = 'ApprovedRevsHooks::addMagicWordVariableIDs';
62 -$wgHooks['LanguageGetMagic'][] = 'ApprovedRevsHooks::addMagicWordLanguage';
6363 $wgHooks['ParserBeforeTidy'][] = 'ApprovedRevsHooks::handleMagicWords';
6464 $wgHooks['AdminLinks'][] = 'ApprovedRevsHooks::addToAdminLinks';
6565 $wgHooks['LoadExtensionSchemaUpdates'][] = 'ApprovedRevsHooks::describeDBSchema';
Index: trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php
@@ -529,17 +529,6 @@
530530 }
531531
532532 /**
533 - * Set the actual value of the magic words
534 - */
535 - static function addMagicWordLanguage( &$magicWords, $langCode ) {
536 - switch( $langCode ) {
537 - default:
538 - $magicWords['MAG_APPROVEDREVS'] = array( 0, '__APPROVEDREVS__' );
539 - }
540 - return true;
541 - }
542 -
543 - /**
544533 * Set values in the page_props table based on the presence of the
545534 * 'APPROVEDREVS' magic word in a page
546535 */

Follow-up revisions

RevisionCommit summaryAuthorDate
r108790Follow-up to r108577 - fixed name of magic fileyaron03:34, 13 January 2012

Comments

#Comment by Nikerabbit (talk | contribs)   13:02, 11 January 2012

Only FIXME for CSS extension?

#Comment by Siebrand (talk | contribs)   15:24, 14 January 2012

There are some 20 more uses in trunk, and I wasn't sure what I wanted to do with this one. I'll come across it again...

#Comment by Johnduhart (talk | contribs)   16:59, 24 January 2012

I've been trying to get your attention on this for several days now, but you never seem to respond.

Right now trunk is in a code slush, and this (a deprecation of a hook) is a considerable change for this late in the process. I'd recommend this wait for 1.20 and all related changes be reverted post branch.

#Comment by Siebrand (talk | contribs)   17:30, 24 January 2012

Hey John. I haven't noticed previous attempts, so I'm glad you tried a way that gave me an email. I asse you pinged in one of the many Orc channels I'm in, but that usually only works when I'm actually there.

As for deprecation: the hook was deprecated in MediaWiki 1.16, so this is just overdue maintenance, as far as I'm concerned.

Status & tagging log