<?php
/**
* @todo document
- * @package MediaWiki
- * @subpackage Maintenance
+ * @addtogroup Maintenance
*/
/** */
function convertLinks() {
global $wgDBtype;
- if( $wgDBtype == 'Postgres' ) {
- print "Links table already ok on PostgreSQL.\n";
+ if( $wgDBtype == 'postgres' ) {
+ print "Links table already ok on Postgres.\n";
return;
}
print "Converting links table to ID-ID...\n";
- global $wgLang, $wgDBserver, $wgDBport, $wgDBadminuser, $wgDBadminpassword, $wgDBname;
+ global $wgLang, $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname;
global $noKeys, $logPerformance, $fh;
- $numRows = $tuplesAdded = $numBadLinks = $curRowsRead = 0; #counters etc
+ $tuplesAdded = $numBadLinks = $curRowsRead = 0; #counters etc
$totalTuplesInserted = 0; # total tuples INSERTed into links_temp
$reportCurReadProgress = true; #whether or not to give progress reports while reading IDs from cur table
$perfLogFilename = "convLinksPerf.txt";
#--------------------------------------------------------------------
- $dbw =& wfGetDB( DB_MASTER );
- extract( $dbw->tableNames( 'cur', 'links', 'links_temp', 'links_backup' ) );
+ $dbw = wfGetDB( DB_MASTER );
+ list ($cur, $links, $links_temp, $links_backup) = $dbw->tableNamesN( 'cur', 'links', 'links_temp', 'links_backup' );
$res = $dbw->query( "SELECT l_from FROM $links LIMIT 1" );
if ( $dbw->fieldType( $res, 0 ) == "int" ) {
#--------------------------------------------------------------------
if ( $overwriteLinksTable ) {
- $dbConn = Database::newFromParams( $wgDBserver, $wgDBport, $wgDBadminuser, $wgDBadminpassword, $wgDBname );
+ $dbConn = Database::newFromParams( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname );
if (!($dbConn->isOpen())) {
print "Opening connection to database failed.\n";
return;
#--------------------------------------------------------------------
function createTempTable() {
- global $wgDBserver, $wgDBport, $wgDBadminuser, $wgDBadminpassword, $wgDBname;
+ global $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname;
global $noKeys;
- $dbConn = Database::newFromParams( $wgDBserver, $wgDBport, $wgDBadminuser, $wgDBadminpassword, $wgDBname );
+ $dbConn = Database::newFromParams( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname );
if (!($dbConn->isOpen())) {
print "Opening connection to database failed.\n";