r25993 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25992‎ | r25993 | r25994 >
Date:14:41, 21 September 2007
Author:nikerabbit
Status:old
Tags:
Comment:
* Bugfix and speed optimization
Modified paths:
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)
  • /trunk/extensions/Translate/TranslateUtils.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/TranslateUtils.php
@@ -89,12 +89,12 @@
9090 }
9191
9292 public static function getMessageContent( $key, $language ) {
 93+ wfProfileIn( __METHOD__ );
9394 $title = self::title( $key, $language );
94 - self::doExistenceQuery();
95 - if ( !isset(self::$contents[$title]) && isset(self::$pageExists[$key]) ) {
 95+ if ( !isset(self::$contents[$title]) ) {
9696 self::getContents( array( $title ) );
9797 }
98 -
 98+ wfProfileOut( __METHOD__ );
9999 return isset(self::$contents[$title]) ? self::$contents[$title] : null;
100100 }
101101
@@ -102,6 +102,7 @@
103103 private static $contents = array();
104104 private static $editors = array();
105105 private static function getContents( Array $titles ) {
 106+ wfProfileIn( __METHOD__ );
106107 $dbr = wfGetDB( DB_SLAVE );
107108 $rows = $dbr->select( array( 'page', 'revision', 'text' ),
108109 array( 'page_title', 'old_text', 'old_flags', 'rev_user_text' ),
@@ -122,13 +123,16 @@
123124 }
124125
125126 $rows->free();
 127+ wfProfileOut( __METHOD__ );
126128 }
127129
128130
129131 private static $pageExists = null;
130132 private static $talkExists = null;
131133 private static function doExistenceQuery() {
 134+ wfProfileIn( __METHOD__ );
132135 if ( self::$pageExists !== null && self::$talkExists !== null ) {
 136+ wfProfileOut( __METHOD__ );
133137 return;
134138 }
135139
@@ -148,6 +152,7 @@
149153 }
150154 }
151155 $rows->free();
 156+ wfProfileOut( __METHOD__ );
152157 }
153158
154159 /* Table output helpers */
Index: trunk/extensions/Translate/MessageGroups.php
@@ -1107,10 +1107,6 @@
11081108
11091109 protected $arrName = 'wgRenameuserMessages';
11101110 protected $messageFile = 'Renameuser/SpecialRenameuser.i18n.php';
1111 -
1112 - function fillBools( &$array ) {
1113 - $array['renameuserlogentry']['ignored'] = true;
1114 - }
11151111 }
11161112
11171113 class ResignMessageGroup extends ExtensionMessageGroup {

Status & tagging log