Merge "Upgrade wikimedia/remex-html to 2.0.1" into REL1_31
[lhc/web/wiklou.git] / maintenance / nukeNS.php
index 0326e02..ee1f59c 100644 (file)
@@ -52,8 +52,8 @@ class NukeNS extends Maintenance {
 
        public function execute() {
                $ns = $this->getOption( 'ns', NS_MEDIAWIKI );
-               $delete = $this->getOption( 'delete', false );
-               $all = $this->getOption( 'all', false );
+               $delete = $this->hasOption( 'delete' );
+               $all = $this->hasOption( 'all' );
                $dbw = $this->getDB( DB_MASTER );
                $this->beginTransaction( $dbw, __METHOD__ );
 
@@ -88,7 +88,7 @@ class NukeNS extends Maintenance {
                                        $dbw->query( "DELETE FROM $tbl_pag WHERE page_id = $id" );
                                        $this->commitTransaction( $dbw, __METHOD__ );
                                        // Delete revisions as appropriate
-                                       $child = $this->runChild( 'NukePage', 'nukePage.php' );
+                                       $child = $this->runChild( NukePage::class, 'nukePage.php' );
                                        $child->deleteRevisions( $revs );
                                        $this->purgeRedundantText( true );
                                        $n_deleted++;
@@ -118,5 +118,5 @@ class NukeNS extends Maintenance {
        }
 }
 
-$maintClass = "NukeNS";
+$maintClass = NukeNS::class;
 require_once RUN_MAINTENANCE_IF_MAIN;