* @ingroup Maintenance
*/
-require_once( dirname(__FILE__) . '/Maintenance.php' );
+require_once( dirname( __FILE__ ) . '/Maintenance.php' );
class DeleteRevision extends Maintenance {
-
+
public function __construct() {
parent::__construct();
$this->mDescription = "Delete one or more revisions by moving them to the archive table";
}
-
+
public function execute() {
- if( count( $this->mArgs ) == 0 ) {
+ if ( count( $this->mArgs ) == 0 ) {
$this->error( "No revisions specified", true );
}
- $this->output( "Deleting revision(s) " . implode( ',', $this->mArgs ) .
+ $this->output( "Deleting revision(s) " . implode( ',', $this->mArgs ) .
" from " . wfWikiID() . "...\n" );
$dbw = wfGetDB( DB_MASTER );
-
+
$affected = 0;
foreach ( $this->mArgs as $revID ) {
$dbw->insertSelect( 'archive', array( 'page', 'revision' ),
}
$maintClass = "DeleteRevision";
-require_once( DO_MAINTENANCE );
+require_once( RUN_MAINTENANCE_IF_MAIN );