Tweak to r47279 -- include final newline to keep the terminal clean :)
[mediawiki.git] / maintenance / deleteOrphanedRevisions.inc.php
blob6678d5b8b194913d5c9f5c0dd6d82937d249666c
1 <?php
3 /**
4 * Support functions for the deleteOrphanedRevisions maintenance script
6 * @file
7 * @ingroup Maintenance
8 * @author Rob Church <robchur@gmail.com>
9 */
11 /**
12 * Delete one or more revisions from the database
13 * Do this inside a transaction
15 * @param $id Array of revision id values
16 * @param $db Database class (needs to be a master)
18 function deleteRevisions( $id, &$dbw ) {
19 if( !is_array( $id ) )
20 $id = array( $id );
21 $dbw->delete( 'revision', array( 'rev_id' => $id ), 'deleteRevision' );
24 /**
25 * Spit out script usage information and exit
27 function showUsage() {
28 echo( "Finds revisions which refer to nonexisting pages and deletes them from the database\n" );
29 echo( "USAGE: php deleteOrphanedRevisions.php [--report]\n\n" );
30 echo( " --report : Prints out a count of affected revisions but doesn't delete them\n\n" );