X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FnukeNS.php;h=0f2dbf64ff686f3a01d40e1a5e737fa6f33238e4;hb=44cebea941236e165bf55e80565d6679529c7280;hp=479dcf7611aa671f2398ff6b51d64748c1fb090e;hpb=525f157e17c0bfaf65ea90e47a88b873bd17c576;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/nukeNS.php b/maintenance/nukeNS.php index 479dcf7611..0f2dbf64ff 100644 --- a/maintenance/nukeNS.php +++ b/maintenance/nukeNS.php @@ -54,8 +54,8 @@ class NukeNS extends Maintenance { $ns = $this->getOption( 'ns', NS_MEDIAWIKI ); $delete = $this->getOption( 'delete', false ); $all = $this->getOption( 'all', false ); - $dbw = wfGetDB( DB_MASTER ); - $dbw->begin( __METHOD__ ); + $dbw = $this->getDB( DB_MASTER ); + $this->beginTransaction( $dbw, __METHOD__ ); $tbl_pag = $dbw->tableName( 'page' ); $tbl_rev = $dbw->tableName( 'revision' ); @@ -86,18 +86,18 @@ class NukeNS extends Maintenance { // I already have the id & revs if ( $delete ) { $dbw->query( "DELETE FROM $tbl_pag WHERE page_id = $id" ); - $dbw->commit( __METHOD__ ); + $this->commitTransaction( $dbw, __METHOD__ ); // Delete revisions as appropriate $child = $this->runChild( 'NukePage', 'nukePage.php' ); $child->deleteRevisions( $revs ); $this->purgeRedundantText( true ); - $n_deleted ++; + $n_deleted++; } } else { $this->output( "skip: " . $title->getPrefixedText() . "\n" ); } } - $dbw->commit( __METHOD__ ); + $this->commitTransaction( $dbw, __METHOD__ ); if ( $n_deleted > 0 ) { # update statistics - better to decrement existing count, or just count