r99574 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99573‎ | r99574 | r99575 >
Date:21:28, 11 October 2011
Author:reedy
Status:ok
Tags:
Comment:
Don't reinvent the wheel to do parameter existence checking

Stops running the code outside the class when there's no point attempting it
Modified paths:
  • /trunk/phase3/maintenance/mergeMessageFileList.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/mergeMessageFileList.php
@@ -32,7 +32,7 @@
3333
3434 function __construct() {
3535 parent::__construct();
36 - $this->addOption( 'list-file', 'A file containing a list of extension setup files, one per line.', false, true );
 36+ $this->addOption( 'list-file', 'A file containing a list of extension setup files, one per line.', true, true );
3737 $this->addOption( 'output', 'Send output to this file (omit for stdout)', false, true );
3838 $this->mDescription = 'Merge $wgExtensionMessagesFiles from various extensions to produce a ' .
3939 'single array containing all message files.';
@@ -40,10 +40,6 @@
4141
4242 public function execute() {
4343 global $mmfl;
44 - if ( !$this->hasOption( 'list-file' ) ) {
45 - $this->error( 'The --list-file option must be specified.' );
46 - return;
47 - }
4844
4945 $lines = file( $this->getOption( 'list-file' ) );
5046 if ( $lines === false ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r99575MFT r99574reedy21:28, 11 October 2011

Status & tagging log