X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FnukePage.php;h=e27324a7588bc822904364238584d01bfa4c91bd;hb=c16f2ef0853f8cdc344ed2a89a5d0a27ef0e3e63;hp=dc455209964a4426e559f1e626a09e8a6a4945a0;hpb=87af058741eac7c63eba52286031645ad5ee8925;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/nukePage.php b/maintenance/nukePage.php index dc45520996..e27324a758 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; }