r93628 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93627‎ | r93628 | r93629 >
Date:16:01, 1 August 2011
Author:mah
Status:ok (Comments)
Tags:
Comment:
w/s changes: “svn diff -x-w” is clean
Modified paths:
  • /trunk/phase3/includes/LinksUpdate.php (modified) (history)
  • /trunk/phase3/includes/Preferences.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseMysql.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/ArticleTablesTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/ArticleTablesTest.php
@@ -7,14 +7,14 @@
88
99 function testbug14404() {
1010 global $wgUser, $wgContLang, $wgLanguageCode, $wgLang;
11 -
 11+
1212 $title = Title::newFromText("Bug 14404");
1313 $article = new Article( $title );
1414 $wgUser = new User();
1515 $wgUser->mRights['*'] = array( 'createpage', 'edit', 'purge' );
1616 $wgLanguageCode = 'es';
1717 $wgContLang = Language::factory( 'es' );
18 -
 18+
1919 $wgLang = Language::factory( 'fr' );
2020 $status = $article->doEdit( '{{:{{int:history}}}}', 'Test code for bug 14404', 0 );
2121 $templates1 = $article->getUsedTemplates();
@@ -22,13 +22,13 @@
2323 $wgLang = Language::factory( 'de' );
2424 $article->mParserOptions = null; // Let it pick the new user language
2525 $article->mPreparedEdit = false; // In order to force the rerendering of the same wikitext
26 -
 26+
2727 // We need an edit, a purge is not enough to regenerate the tables
2828 $status = $article->doEdit( '{{:{{int:history}}}}', 'Test code for bug 14404', EDIT_UPDATE );
2929 $templates2 = $article->getUsedTemplates();
30 -
 30+
3131 $this->assertEquals( $templates1, $templates2 );
3232 $this->assertEquals( $templates1[0]->getFullText(), 'Historial' );
3333 }
34 -
 34+
3535 }
Index: trunk/phase3/includes/db/DatabaseMysql.php
@@ -175,7 +175,7 @@
176176 return $row;
177177 }
178178
179 - function fetchRow( $res ) {
 179+ function fetchRow( $res ) {
180180 if ( $res instanceof ResultWrapper ) {
181181 $res = $res->result;
182182 }
@@ -432,7 +432,7 @@
433433 }
434434 return false;
435435 }
436 -
 436+
437437 /**
438438 * Wait for the slave to catch up to a given master position.
439439 *
@@ -672,7 +672,7 @@
673673 }
674674 $this->query( $query, $fname );
675675 }
676 -
 676+
677677 /**
678678 * List all tables on the database
679679 *
@@ -692,7 +692,7 @@
693693 $endArray[] = $table;
694694 }
695695 }
696 -
 696+
697697 return $endArray;
698698 }
699699
Index: trunk/phase3/includes/LinksUpdate.php
@@ -135,7 +135,7 @@
136136 # External links
137137 $existing = $this->getExistingExternals();
138138 $this->incrTableUpdate( 'externallinks', 'el', $this->getExternalDeletions( $existing ),
139 - $this->getExternalInsertions( $existing ) );
 139+ $this->getExternalInsertions( $existing ) );
140140
141141 # Language links
142142 $existing = $this->getExistingInterlangs();
@@ -497,16 +497,16 @@
498498 * @private
499499 */
500500 function getInterlangInsertions( $existing = array() ) {
501 - $diffs = array_diff_assoc( $this->mInterlangs, $existing );
502 - $arr = array();
503 - foreach( $diffs as $lang => $title ) {
504 - $arr[] = array(
505 - 'll_from' => $this->mId,
506 - 'll_lang' => $lang,
507 - 'll_title' => $title
508 - );
509 - }
510 - return $arr;
 501+ $diffs = array_diff_assoc( $this->mInterlangs, $existing );
 502+ $arr = array();
 503+ foreach( $diffs as $lang => $title ) {
 504+ $arr[] = array(
 505+ 'll_from' => $this->mId,
 506+ 'll_lang' => $lang,
 507+ 'll_title' => $title
 508+ );
 509+ }
 510+ return $arr;
511511 }
512512
513513 /**
@@ -612,7 +612,7 @@
613613 * @private
614614 */
615615 function getInterlangDeletions( $existing ) {
616 - return array_diff_assoc( $existing, $this->mInterlangs );
 616+ return array_diff_assoc( $existing, $this->mInterlangs );
617617 }
618618
619619 /**
Index: trunk/phase3/includes/Preferences.php
@@ -1250,7 +1250,7 @@
12511251 if ( $wgLocalTZoffset == date( 'Z' ) / 60 ) {
12521252 $server_tz_msg = wfMsg( 'timezoneuseserverdefault', $wgLocaltimezone );
12531253 } else {
1254 - $tzstring = sprintf( '%+03d:%02d', floor( $wgLocalTZoffset / 60 ), abs( $wgLocalTZoffset ) % 60 );
 1254+ $tzstring = sprintf( '%+03d:%02d', floor( $wgLocalTZoffset / 60 ), abs( $wgLocalTZoffset ) % 60 );
12551255 $server_tz_msg = wfMsg( 'timezoneuseserverdefault', $tzstring );
12561256 }
12571257 $opt[$server_tz_msg] = "System|$wgLocalTZoffset";

Comments

#Comment by Nikerabbit (talk | contribs)   16:04, 1 August 2011

There seems to be one extra tab in LinksUpdate.

#Comment by MarkAHershberger (talk | contribs)   20:32, 1 August 2011

it's not.

#Comment by Nikerabbit (talk | contribs)   06:38, 2 August 2011

Aww, I missed the comma.

Status & tagging log