X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FdeleteArchivedFiles.php;h=ad7b54d078e30169c52251f2220645bfff47e0dc;hb=beb1c4a0eced04ce2098433c383f1fbe469569c9;hp=0b5a03ce0a6985422fd0ac768266923f6b38a13e;hpb=9288ab2f4855b4e164137c0dacfbbdf3d9cd7de8;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/deleteArchivedFiles.php b/maintenance/deleteArchivedFiles.php index 0b5a03ce0a..ad7b54d078 100644 --- a/maintenance/deleteArchivedFiles.php +++ b/maintenance/deleteArchivedFiles.php @@ -1,31 +1,58 @@ mDescription = "Deletes all archived images."; + $this->addOption( 'delete', 'Perform the deletion' ); + $this->addOption( 'force', 'Force deletion of rows from filearchive' ); + } -if( @$options['help'] ) { - ShowUsage(); -} else { - DeleteArchivedFiles( @$options['delete'] ); -} + public function handleOutput( $str ) { + return $this->output( $str ); + } -function ShowUsage() { - echo( "Deletes all archived images.\n\n" ); - echo( "These images will no longer be restorable.\n\n" ); - echo( "Usage: php deleteArchivedRevisions.php [--delete|--help]\n\n" ); - echo( "delete : Performs the deletion\n" ); - echo( " help : Show this usage information\n" ); + public function execute() { + if ( !$this->hasOption( 'delete' ) ) { + $this->output( "Use --delete to actually confirm this script\n" ); + return; + } + $force = $this->hasOption( 'force' ); + DeleteArchivedFilesImplementation::doDelete( $this, $force ); + } } -?> \ No newline at end of file +$maintClass = "DeleteArchivedFiles"; +require_once RUN_MAINTENANCE_IF_MAIN;