/**
* Support functions for the nukeArticle script
*
- * @package MediaWiki
- * @subpackage Maintenance
+ * @file
+ * @ingroup Maintenance
* @author Rob Church <robchur@gmail.com>
*/
function NukePage( $name, $delete = false ) {
- $dbw =& wfGetDB( DB_MASTER );
+ $dbw = wfGetDB( DB_MASTER );
$dbw->begin();
$tbl_pag = $dbw->tableName( 'page' );
if( $title ) {
$id = $title->getArticleID();
$real = $title->getPrefixedText();
+ $isGoodArticle = $title->isContentPage();
echo( "found \"$real\" with ID $id.\n" );
# Get corresponding revisions
PurgeRedundantText( true );
}
+ # Update stats as appropriate
+ if ( $delete ) {
+ echo( "Updating site stats..." );
+ $ga = $isGoodArticle ? -1 : 0; // if it was good, decrement that too
+ $stats = new SiteStatsUpdate( 0, -$count, $ga, -1 );
+ $stats->doUpdate();
+ echo( "done.\n" );
+ }
+
+
} else {
echo( "not found in database.\n" );
$dbw->commit();
function DeleteRevisions( $ids ) {
- $dbw =& wfGetDB( DB_MASTER );
+ $dbw = wfGetDB( DB_MASTER );
$dbw->begin();
$tbl_rev = $dbw->tableName( 'revision' );