r62800 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62799‎ | r62800 | r62801 >
Date:00:54, 22 February 2010
Author:demon
Status:resolved (Comments)
Tags:
Comment:
Cleanup r62798: If you add a new param then document it, simplify check for --force
Modified paths:
  • /trunk/phase3/maintenance/deleteArchivedFiles.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/deleteArchivedFiles.php
@@ -30,6 +30,7 @@
3131 parent::__construct();
3232 $this->mDescription = "Deletes all archived images.";
3333 $this->addOption( 'delete', 'Perform the deletion' );
 34+ $this->addOption( 'force', 'Force deletion of rows from filearchive' );
3435 }
3536
3637 public function execute() {
@@ -37,10 +38,7 @@
3839 $this->output( "Use --delete to actually confirm this script\n" );
3940 return;
4041 }
41 - $force = false;
42 - if( $this->hasOption('force') ) {
43 - $force = true;
44 - }
 42+ $force = $this->hasOption( 'force ');
4543 # Data should come off the master, wrapped in a transaction
4644 $dbw = wfGetDB( DB_MASTER );
4745 $dbw->begin();

Follow-up revisions

RevisionCommit summaryAuthorDate
r62801follow up r62800 fix typomah01:12, 22 February 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r62798add --force option to delete db table rowsmah00:37, 22 February 2010

Comments

#Comment by MarkAHershberger (talk | contribs)   01:12, 22 February 2010

Also, you should test your code. ;)

Status & tagging log