X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;ds=sidebyside;f=maintenance%2FnukePage.php;h=1057ea94a95e121a73a890366df394d00c3a391b;hb=1fdedd3fc507a32586331c8ef77f4fe960bda516;hp=1cf3c79ff6a9d18db70919252604b91627ec69ef;hpb=44729064cd299f86611dcbb7f54e092b7e4d19a9;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/nukePage.php b/maintenance/nukePage.php index 1cf3c79ff6..1057ea94a9 100644 --- a/maintenance/nukePage.php +++ b/maintenance/nukePage.php @@ -22,14 +22,14 @@ * @author Rob Church */ -require_once( dirname(__FILE__) . '/Maintenance.php' ); +require_once( dirname( __FILE__ ) . '/Maintenance.php' ); class NukePage extends Maintenance { public function __construct() { parent::__construct(); $this->mDescription = "Remove a page record from the database"; $this->addOption( 'delete', "Actually delete the page" ); - $this->addArgs( array( 'title' ) ); + $this->addArg( 'title', 'Title to delete' ); } public function execute() { @@ -47,7 +47,7 @@ class NukePage extends Maintenance { # Get page ID $this->output( "Searching for \"$name\"..." ); $title = Title::newFromText( $name ); - if( $title ) { + if ( $title ) { $id = $title->getArticleID(); $real = $title->getPrefixedText(); $isGoodArticle = $title->isContentPage(); @@ -56,14 +56,14 @@ 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" ); - foreach( $res as $row ) { + foreach ( $res as $row ) { $revs[] = $row->rev_id; } $count = count( $revs ); $this->output( "found $count.\n" ); # Delete the page record and associated recent changes entries - if( $delete ) { + if ( $delete ) { $this->output( "Deleting page record..." ); $dbw->query( "DELETE FROM $tbl_pag WHERE page_id = $id" ); $this->output( "done.\n" ); @@ -75,7 +75,7 @@ class NukePage extends Maintenance { $dbw->commit(); # Delete revisions as appropriate - if( $delete && $count ) { + if ( $delete && $count ) { $this->output( "Deleting revisions..." ); $this->deleteRevisions( $revs ); $this->output( "done.\n" ); @@ -105,7 +105,7 @@ class NukePage extends Maintenance { $set = implode( ', ', $ids ); $dbw->query( "DELETE FROM $tbl_rev WHERE rev_id IN ( $set )" ); - $dbw->commit(); + $dbw->commit(); } }