diff options
author | Chad Horohoe <demon@users.mediawiki.org> | 2009-06-24 02:02:37 +0000 |
---|---|---|
committer | Chad Horohoe <demon@users.mediawiki.org> | 2009-06-24 02:02:37 +0000 |
commit | 59b60fc31194b3b09bba2c95b8ddf85c3f9e81bb (patch) | |
tree | a93a622c1f9e5d577c8c3614c02dfc876b108afd /maintenance/purgeOldText.php | |
parent | 67a31fd20082081506ea93387b4b442ed0127ced (diff) | |
download | mediawikicore-59b60fc31194b3b09bba2c95b8ddf85c3f9e81bb.tar.gz mediawikicore-59b60fc31194b3b09bba2c95b8ddf85c3f9e81bb.zip |
Merge maintenance-work branch:
* (bug 16322) Allow maint scripts to accept DB user/pass over input or params if no AdminSettings.php
* (bug 18768) Remove AdminSettings.php from MediaWiki core
* (bug 19157) createAndPromote error on bad password
* (bug 14201) Create AdminSettings.php during wiki installation, in the same way as LocalSettings.php
* Introduce new Maintenance class framework and port a good number of scripts over; the ones that are left are a little more complicated. Read the docs.
* Not deleting "unused" files yet, don't want to break everything at once :)
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/52336
Diffstat (limited to 'maintenance/purgeOldText.php')
-rw-r--r-- | maintenance/purgeOldText.php | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/maintenance/purgeOldText.php b/maintenance/purgeOldText.php index 4a4be4822b11..08f5ef1aacaa 100644 --- a/maintenance/purgeOldText.php +++ b/maintenance/purgeOldText.php @@ -1,29 +1,24 @@ <?php - /** * Purge old text records from the database * - * @file * @ingroup Maintenance * @author Rob Church <robchur@gmail.com> */ -$options = array( 'purge', 'help' ); -require_once( 'commandLine.inc' ); -require_once( 'purgeOldText.inc' ); - -echo( "Purge Old Text\n\n" ); - -if( @$options['help'] ) { - ShowUsage(); -} else { - PurgeRedundantText( @$options['purge'] ); -} +require_once( "Maintenance.php" ); -function ShowUsage() { - echo( "Prunes unused text records from the database.\n\n" ); - echo( "Usage: php purgeOldText.php [--purge]\n\n" ); - echo( "purge : Performs the deletion\n" ); - echo( " help : Show this usage information\n" ); +class PurgeOldText extends Maintenance { + public function __construct() { + parent::__construct(); + $this->mDescription = "Purge old text records from the database"; + $this->addOption( 'purge', 'Performs the deletion' ); + } + + public function execute() { + $this->purgeRedundantText( $this->hasOption('purge') ); + } } +$maintClass = "PurgeOldText"; +require_once( DO_MAINTENANCE ); |