phpcs: More require/include is not a function
[lhc/web/wiklou.git] / maintenance / cleanupSpam.php
index bbe0609..4b8c9fe 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
 
 /**
  * Maintenance script to cleanup all spam from a given hostname.
@@ -44,7 +44,7 @@ class CleanupSpam extends Maintenance {
                $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() ) {
@@ -141,4 +141,4 @@ class CleanupSpam extends Maintenance {
 }
 
 $maintClass = "CleanupSpam";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;