global $wgUser;
$this->output( "Checking existence of old default messages..." );
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = $this->getDB( DB_SLAVE );
$res = $dbr->select( array( 'page', 'revision' ),
array( 'page_namespace', 'page_title' ),
array(
# Handle deletion
$this->output( "\n...deleting old default messages (this may take a long time!)...", 'msg' );
- $dbw = wfGetDB( DB_MASTER );
+ $dbw = $this->getDB( DB_MASTER );
foreach ( $res as $row ) {
wfWaitForSlaves();
$dbw->ping();
$title = Title::makeTitle( $row->page_namespace, $row->page_title );
$page = WikiPage::factory( $title );
- $dbw->begin( __METHOD__ );
$error = ''; // Passed by ref
- $page->doDeleteArticle( 'No longer required', false, 0, false, $error, $user );
- $dbw->commit( __METHOD__ );
+ // FIXME: Deletion failures should be reported, not silently ignored.
+ $page->doDeleteArticle( 'No longer required', false, 0, true, $error, $user );
}
$this->output( "done!\n", 'msg' );