r48893 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48892‎ | r48893 | r48894 >
Date:19:49, 26 March 2009
Author:demon
Status:ok
Tags:
Comment:
Delay message loading until the messages are actually needed. Nuke useless setup function and assign the hook directly.
Modified paths:
  • /trunk/extensions/BackAndForth/BackAndForth.class.php (modified) (history)
  • /trunk/extensions/BackAndForth/BackAndForth.php (modified) (history)

Diff [purge]

Index: trunk/extensions/BackAndForth/BackAndForth.class.php
@@ -65,6 +65,7 @@
6666 )
6767 );
6868 if( $dbr->numRows( $res ) > 0 ) {
 69+ wfLoadExtensionMessages( 'BackAndForth' );
6970 $row = $dbr->fetchObject( $res );
7071 $dbr->freeResult( $res );
7172 $target = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
Index: trunk/extensions/BackAndForth/BackAndForth.php
@@ -13,7 +13,7 @@
1414 }
1515
1616 $wgAutoloadClasses['BackAndForth'] = dirname( __FILE__ ) . '/BackAndForth.class.php';
17 -$wgExtensionFunctions[] = 'efBackAndForth';
 17+$wgHooks['ArticleViewHeader'][] = 'BackAndForth::viewHook';
1818 $wgExtensionCredits['other'][] = array(
1919 'name' => 'Back and Forth',
2020 'author' => 'Rob Church',
@@ -23,14 +23,3 @@
2424 );
2525
2626 $wgExtensionMessagesFiles['BackAndForth'] = dirname(__FILE__) . '/BackAndForth.i18n.php';
27 -
28 -/**
29 - * Extension setup function
30 - */
31 -function efBackAndForth() {
32 - global $wgHooks;
33 -
34 - wfLoadExtensionMessages( 'BackAndForth' );
35 -
36 - $wgHooks['ArticleViewHeader'][] = 'BackAndForth::viewHook';
37 -}

Status & tagging log