r36436 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36435‎ | r36436 | r36437 >
Date:22:59, 18 June 2008
Author:demon
Status:old
Tags:
Comment:
Lazy-load messages. No need to initialize those on every single pageload.
Modified paths:
  • /trunk/extensions/NetworkAuth/NetworkAuth.php (modified) (history)

Diff [purge]

Index: trunk/extensions/NetworkAuth/NetworkAuth.php
@@ -20,6 +20,7 @@
2121 );
2222
2323 $wgExtensionFunctions[] = 'efNetworkAuth_Setup';
 24+$wgExtensionMessagesFiles['NetworkAuth'] = dirname(__FILE__) . '/' 'NetworkAuth.i18n.php';
2425
2526 function efNetworkAuth_Setup() {
2627 global $wgRequest;
@@ -35,13 +36,6 @@
3637 }
3738 }
3839
39 - #Add Messages
40 - global $wgMessageCache;
41 - require( dirname( __FILE__ ) . '/NetworkAuth.i18n.php' );
42 - foreach( $messages as $key => $value ) {
43 - $wgMessageCache->addMessages( $messages[$key], $key );
44 - }
45 -
4640 efNetworkAuth_Authenticate();
4741
4842 return true;
@@ -160,6 +154,10 @@
161155
162156 function efNetworkAuth_PersonalUrls($personal_urls, $title) {
163157 global $wgNetworkAuthUser, $wgNetworkAuthHost;
 158+
 159+ // Lazy load the i18n stuff here
 160+ wfLoadExtensionMessages('NetworkAuth');
 161+
164162 if (isset($personal_urls['anonuserpage'])) {
165163 $personal_urls['anonuserpage']['text'] =
166164 wfMsg('networkauth-purltext', $wgNetworkAuthUser, $wgNetworkAuthHost);

Status & tagging log