* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to cleanup all spam from a given hostname.
}
public function execute() {
- global $wgLocalDatabases, $wgUser;
+ global $IP, $wgLocalDatabases, $wgUser;
$username = wfMessage( 'spambot_username' )->text();
$wgUser = User::newFromName( $username );
if ( !$wgUser ) {
- $this->error( "Invalid username", true );
+ $this->error( "Invalid username specified in 'spambot_username' message: $username", true );
}
// Create the user if necessary
if ( !$wgUser->getId() ) {
array( 'el_index' . $dbr->buildLike( $like ) ), __METHOD__ );
if ( $count ) {
$found = true;
- passthru( "php cleanupSpam.php --wiki='$wikiID' $spec | sed 's/^/$wikiID: /'" );
+ $cmd = wfShellWikiCmd( "$IP/maintenance/cleanupSpam.php",
+ array( '--wiki', $wikiID, $spec ) );
+ passthru( "$cmd | sed 's/^/$wikiID: /'" );
}
}
if ( $found ) {
}
$maintClass = "CleanupSpam";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;