Use ::class to resolve class names in maintenance scripts
[lhc/web/wiklou.git] / maintenance / initEditCount.php
index a19ad9b..3c4336f 100644 (file)
@@ -42,8 +42,6 @@ in the load balancer, usually indicating a replication environment.' );
                $user = $dbw->tableName( 'user' );
                $revision = $dbw->tableName( 'revision' );
 
-               $dbver = $dbw->getServerVersion();
-
                // Autodetect mode...
                if ( $this->hasOption( 'background' ) ) {
                        $backgroundMode = true;
@@ -56,7 +54,7 @@ in the load balancer, usually indicating a replication environment.' );
                if ( $backgroundMode ) {
                        $this->output( "Using replication-friendly background mode...\n" );
 
-                       $dbr = $this->getDB( DB_SLAVE );
+                       $dbr = $this->getDB( DB_REPLICA );
                        $chunkSize = 100;
                        $lastUser = $dbr->selectField( 'user', 'MAX(user_id)', '', __METHOD__ );
 
@@ -103,5 +101,5 @@ in the load balancer, usually indicating a replication environment.' );
        }
 }
 
-$maintClass = "InitEditCount";
+$maintClass = InitEditCount::class;
 require_once RUN_MAINTENANCE_IF_MAIN;