r57349 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57348‎ | r57349 | r57350 >
Date:23:03, 3 October 2009
Author:laner
Status:deferred
Tags:
Comment:
Fix backwards compatability with MediaWiki less than 1.16alpha
Modified paths:
  • /trunk/extensions/Plotters/Plotters.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Plotters/Plotters.php
@@ -27,7 +27,7 @@
2828 $wgExtensionCredits['other'][] = array(
2929 'path' => __FILE__,
3030 'name' => 'Plotter parser extension',
31 - 'version' => '0.6a',
 31+ 'version' => '0.6b',
3232 'author' => 'Ryan Lane',
3333 'description' => 'Allows users to create client side graphs and plots',
3434 'descriptionmsg' => 'plotters-desc',
@@ -37,6 +37,9 @@
3838 $wgExtensionFunctions[] = "efPlotters";
3939
4040 $wgHooks['OutputPageParserOutput'][] = 'PlottersParserOutput';
 41+if( version_compare( $wgVersion, '1.16alpha', '<' ) ) {
 42+ $wgHooks['LanguageGetMagic'][] = 'PlottersLanguageGetMagic';
 43+}
4144 $wgHooks['ArticleSaveComplete'][] = 'wfPlottersArticleSaveComplete';
4245
4346 $dir = dirname( __FILE__ ) . '/';
@@ -246,3 +249,13 @@
247250 }
248251 return true;
249252 }
 253+
 254+// FIXME: doesn't this make using this method and the hook above useless?
 255+/**
 256+ * We ignore langCode - parser function names can be translated but
 257+ * we are not using this feature
 258+ */
 259+function PlottersLanguageGetMagic( &$magicWords, $langCode ) {
 260+ $magicWords['plot'] = array( 0, 'plot' );
 261+ return true;
 262+}

Status & tagging log