X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FnukePage.php;h=baead9476c109328252262e7e30e6b1bf4e5942d;hb=82ffec0c97354a7694eb1758ef943f312ed64f0e;hp=dc455209964a4426e559f1e626a09e8a6a4945a0;hpb=04fdc78370dbc042116488d6826e19bf3910273b;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/nukePage.php b/maintenance/nukePage.php index dc45520996..baead9476c 100644 --- a/maintenance/nukePage.php +++ b/maintenance/nukePage.php @@ -33,15 +33,14 @@ require_once __DIR__ . '/Maintenance.php'; class NukePage extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = "Remove a page record from the database"; + $this->addDescription( 'Remove a page record from the database' ); $this->addOption( 'delete', "Actually delete the page" ); $this->addArg( 'title', 'Title to delete' ); } public function execute() { - $name = $this->getArg(); - $delete = $this->getOption( 'delete', false ); + $delete = $this->hasOption( 'delete' ); $dbw = $this->getDB( DB_MASTER ); $this->beginTransaction( $dbw, __METHOD__ ); @@ -62,7 +61,7 @@ class NukePage extends Maintenance { # Get corresponding revisions $this->output( "Searching for revisions..." ); $res = $dbw->query( "SELECT rev_id FROM $tbl_rev WHERE rev_page = $id" ); - $revs = array(); + $revs = []; foreach ( $res as $row ) { $revs[] = $row->rev_id; } @@ -116,5 +115,5 @@ class NukePage extends Maintenance { } } -$maintClass = "NukePage"; +$maintClass = NukePage::class; require_once RUN_MAINTENANCE_IF_MAIN;