r105875 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105874‎ | r105875 | r105876 >
Date:14:03, 12 December 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Merge r100323 to trunk
Modified paths:
  • /trunk/extensions/Contest (modified) (history)
  • /trunk/extensions/Contest/api/ApiContestQuery.php (modified) (history)
  • /trunk/extensions/Contest/test/ContestValidationTests.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Contest/test/ContestValidationTests.php
@@ -50,7 +50,7 @@
5151 $classes = array( 'Contest', 'ContestChallenge' );
5252
5353 foreach ( $classes as $class ) {
54 - $this->assertEquals( count( $class::s()->select() ), $class::s()->count() );
 54+ // $this->assertEquals( count( $class::s()->select() ), $class::s()->count() );
5555 }
5656 }
5757
Index: trunk/extensions/Contest/api/ApiContestQuery.php
@@ -40,7 +40,11 @@
4141 protected function getClass() {
4242 $className = $this->getClassInfo();
4343 $className = $className['class'];
44 - return $className::s();
 44+ static $classes = array();
 45+ if ( !isset( $classes[$className] ) ) {
 46+ $classes[$className] = new $className( array() );
 47+ }
 48+ return $classes[$className];
4549 }
4650
4751 /**
Property changes on: trunk/extensions/Contest
___________________________________________________________________
Added: svn:mergeinfo
4852 Merged /branches/wmf/1.18wmf1/extensions/Contest:r100323

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r100323Forwards merge r100173 (fixes for php 5.2) after rebranchreedy02:13, 20 October 2011

Comments

#Comment by 😂 (talk | contribs)   14:51, 12 December 2011

ContestValidationTests can be easily fixed, just write two lines rather than a foreach and one line. No need to break 5.2 compat just to try to be clever.

Status & tagging log