# External links
$existing = $this->getExistingExternals();
$this->incrTableUpdate( 'externallinks', 'el', $this->getExternalDeletions( $existing ),
- $this->getExternalInsertions( $existing ) );
+ $this->getExternalInsertions( $existing ) );
# Language links
$existing = $this->getExistingInterlangs();
* @private
*/
function getInterlangInsertions( $existing = array() ) {
- $diffs = array_diff_assoc( $this->mInterlangs, $existing );
- $arr = array();
- foreach( $diffs as $lang => $title ) {
- $arr[] = array(
- 'll_from' => $this->mId,
- 'll_lang' => $lang,
- 'll_title' => $title
- );
- }
- return $arr;
+ $diffs = array_diff_assoc( $this->mInterlangs, $existing );
+ $arr = array();
+ foreach( $diffs as $lang => $title ) {
+ $arr[] = array(
+ 'll_from' => $this->mId,
+ 'll_lang' => $lang,
+ 'll_title' => $title
+ );
+ }
+ return $arr;
}
/**
* @private
*/
function getInterlangDeletions( $existing ) {
- return array_diff_assoc( $existing, $this->mInterlangs );
+ return array_diff_assoc( $existing, $this->mInterlangs );
}
/**
if ( $wgLocalTZoffset == date( 'Z' ) / 60 ) {
$server_tz_msg = wfMsg( 'timezoneuseserverdefault', $wgLocaltimezone );
} else {
- $tzstring = sprintf( '%+03d:%02d', floor( $wgLocalTZoffset / 60 ), abs( $wgLocalTZoffset ) % 60 );
+ $tzstring = sprintf( '%+03d:%02d', floor( $wgLocalTZoffset / 60 ), abs( $wgLocalTZoffset ) % 60 );
$server_tz_msg = wfMsg( 'timezoneuseserverdefault', $tzstring );
}
$opt[$server_tz_msg] = "System|$wgLocalTZoffset";
return $row;
}
- function fetchRow( $res ) {
+ function fetchRow( $res ) {
if ( $res instanceof ResultWrapper ) {
$res = $res->result;
}
}
return false;
}
-
+
/**
* Wait for the slave to catch up to a given master position.
*
}
$this->query( $query, $fname );
}
-
+
/**
* List all tables on the database
*
$endArray[] = $table;
}
}
-
+
return $endArray;
}
function testbug14404() {
global $wgUser, $wgContLang, $wgLanguageCode, $wgLang;
-
+
$title = Title::newFromText("Bug 14404");
$article = new Article( $title );
$wgUser = new User();
$wgUser->mRights['*'] = array( 'createpage', 'edit', 'purge' );
$wgLanguageCode = 'es';
$wgContLang = Language::factory( 'es' );
-
+
$wgLang = Language::factory( 'fr' );
$status = $article->doEdit( '{{:{{int:history}}}}', 'Test code for bug 14404', 0 );
$templates1 = $article->getUsedTemplates();
$wgLang = Language::factory( 'de' );
$article->mParserOptions = null; // Let it pick the new user language
$article->mPreparedEdit = false; // In order to force the rerendering of the same wikitext
-
+
// We need an edit, a purge is not enough to regenerate the tables
$status = $article->doEdit( '{{:{{int:history}}}}', 'Test code for bug 14404', EDIT_UPDATE );
$templates2 = $article->getUsedTemplates();
-
+
$this->assertEquals( $templates1, $templates2 );
$this->assertEquals( $templates1[0]->getFullText(), 'Historial' );
}
-
+
}