r43428 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43427‎ | r43428 | r43429 >
Date:23:55, 12 November 2008
Author:werdna
Status:old
Tags:
Comment:
Don't confuse the heck out of people by using 'id' for a variable that contains a name, particularly when the two are opposites.
Modified paths:
  • /trunk/extensions/CentralAuth/WikiSet.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/WikiSet.php
@@ -58,22 +58,22 @@
5959 );
6060 }
6161
62 - public static function newFromName( $id, $useCache = true ) {
 62+ public static function newFromName( $name, $useCache = true ) {
6363 if( $useCache ) {
6464 global $wgMemc;
65 - $data = $wgMemc->get( self::memcKey( "name:" . md5( $id ) ) );
 65+ $data = $wgMemc->get( self::memcKey( "name:" . md5( $name ) ) );
6666 if( $data ) {
6767 if( $data['mVersion'] == self::VERSION ) {
6868 $ws = new WikiSet( null, null, null );
69 - foreach( $data as $name => $val )
70 - $ws->$name = $val;
 69+ foreach( $data as $key => $val )
 70+ $ws->$key = $val;
7171 return $ws;
7272 }
7373 }
7474 }
7575 $dbr = CentralAuthUser::getCentralSlaveDB();
7676 $row = $dbr->selectRow(
77 - 'wikiset', '*', array( 'ws_name' => $id ), __METHOD__
 77+ 'wikiset', '*', array( 'ws_name' => $name ), __METHOD__
7878 );
7979 if( !$row )
8080 return null;

Status & tagging log