Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/164781
Change subject: Fix checkLocalNames ...................................................................... Fix checkLocalNames Also cleanup in using __METHOD__ instead of __FUNCTION__, use wfGetDB directly instead of wfGetLB. Change-Id: Ic40e8cd2511491445f530faadd6fdf5a2873a5e2 (cherry picked from commit 605d61f786f73ebea6f8429108159af96f19933f) --- M maintenance/checkLocalNames.php 1 file changed, 11 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth refs/changes/81/164781/1 diff --git a/maintenance/checkLocalNames.php b/maintenance/checkLocalNames.php index ab1e6bc..50131a9 100644 --- a/maintenance/checkLocalNames.php +++ b/maintenance/checkLocalNames.php @@ -49,7 +49,7 @@ 'localnames', array( 'ln_wiki' ), "", - __FUNCTION__, + __METHOD__, array( "DISTINCT", "ORDER BY" => "ln_wiki ASC" @@ -63,7 +63,7 @@ // iterate through the wikis foreach( $wikis as $wiki ) { - $localdb = wfGetLB( $wiki )->getConnection( DB_SLAVE , array(), $wiki ); + $localdb = wfGetDB( DB_SLAVE , array(), $wiki ); $lastUsername = ""; $this->output( "Checking localnames for $wiki ...\n" ); @@ -73,12 +73,12 @@ $this->output( "\t ... querying from '$lastUsername'\n" ); $result = $centralSlave->select( 'localnames', - array( 'ln_user' ), + array( 'ln_name' ), array( "ln_wiki" => $wiki, - "ln_user > " . $centralSlave->addQuotes( $lastUsername ) + "ln_name > " . $centralSlave->addQuotes( $lastUsername ) ), - __FUNCTION__, + __METHOD__, array( "LIMIT" => $this->batchSize, "ORDER BY" => "ln_name ASC" @@ -90,14 +90,14 @@ $localUser = $localdb->select( 'user', array( 'user_name' ), - array( "user_name" => $u->user_name ), - __FUNCTION__ + array( "user_name" => $u->ln_name ), + __METHOD__ ); // check to see if the user did not exist in the local user table if( $localUser->numRows() == 0 ) { if( $this->verbose ) { - $this->output( "Local user not found for localname entry $u->user_name@$wiki\n" ); + $this->output( "Local user not found for localname entry $u->ln_name@$wiki\n" ); } $this->total++; if( !$this->dryrun ){ @@ -106,15 +106,15 @@ 'localnames', array( "ln_wiki" => $wiki, - "ln_user" => $u->user_name + "ln_name" => $u->ln_name ), - __FUNCTION__ + __METHOD__ ); // TODO: is there anyway to check the success of the delete? $this->deleted++; } } - $lastUsername = $u->user_name; + $lastUsername = $u->ln_name; } } while ( $result->numRows() > 0 ); -- To view, visit https://gerrit.wikimedia.org/r/164781 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic40e8cd2511491445f530faadd6fdf5a2873a5e2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralAuth Gerrit-Branch: REL1_23 Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits