X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FpurgeOldText.php;h=ee6f56e5a6f14fa5643daf25a329714b0d9bf98b;hb=5cd45f79d1b9164e87040da8d9a204e19fa2938b;hp=4a4be4822b11d24f2b2c95b2d34a94bc43d10b48;hpb=087a9f70c5c152b72dc6c539cf64e334a0f2d029;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/purgeOldText.php b/maintenance/purgeOldText.php index 4a4be4822b..ee6f56e5a6 100644 --- a/maintenance/purgeOldText.php +++ b/maintenance/purgeOldText.php @@ -1,29 +1,39 @@ */ -$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( dirname( __FILE__ ) . '/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 );