X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcleanupSpam.php;h=4e47cfba57a88043e6edd40bcf88506e3609bd8f;hb=2f28050b6b866f684da92c1832c0a3938b59ef0b;hp=020f5cd75b8986fffe3e3b794a390ead07247ba1;hpb=4dc3ac1c375b3d2eb6172dfef8fdebe71b8c5f43;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/cleanupSpam.php b/maintenance/cleanupSpam.php index 020f5cd75b..4e47cfba57 100644 --- a/maintenance/cleanupSpam.php +++ b/maintenance/cleanupSpam.php @@ -64,14 +64,14 @@ class CleanupSpam extends Maintenance { $this->output( "Finding spam on " . count( $wgLocalDatabases ) . " wikis\n" ); $found = false; foreach ( $wgLocalDatabases as $wikiID ) { - $dbr = $this->getDB( DB_SLAVE, array(), $wikiID ); + $dbr = $this->getDB( DB_REPLICA, [], $wikiID ); $count = $dbr->selectField( 'externallinks', 'COUNT(*)', - array( 'el_index' . $dbr->buildLike( $like ) ), __METHOD__ ); + [ 'el_index' . $dbr->buildLike( $like ) ], __METHOD__ ); if ( $count ) { $found = true; $cmd = wfShellWikiCmd( "$IP/maintenance/cleanupSpam.php", - array( '--wiki', $wikiID, $spec ) ); + [ '--wiki', $wikiID, $spec ] ); passthru( "$cmd | sed 's/^/$wikiID: /'" ); } } @@ -83,9 +83,9 @@ class CleanupSpam extends Maintenance { } else { // Clean up spam on this wiki - $dbr = $this->getDB( DB_SLAVE ); - $res = $dbr->select( 'externallinks', array( 'DISTINCT el_from' ), - array( 'el_index' . $dbr->buildLike( $like ) ), __METHOD__ ); + $dbr = $this->getDB( DB_REPLICA ); + $res = $dbr->select( 'externallinks', [ 'DISTINCT el_from' ], + [ 'el_index' . $dbr->buildLike( $like ) ], __METHOD__ ); $count = $dbr->numRows( $res ); $this->output( "Found $count articles containing $spec\n" ); foreach ( $res as $row ) {