r58037 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58036‎ | r58037 | r58038 >
Date:21:43, 22 October 2009
Author:siebrand
Status:ok (Comments)
Tags:
Comment:
Revert r58033. This change made all command line scripts of the Translate extension (scripts/ subfolder) exit without any information or without doing anything.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/maintenance/Maintenance.php (modified) (history)
  • /trunk/phase3/maintenance/doMaintenance.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/doMaintenance.php
@@ -86,13 +86,10 @@
8787
8888 // Do the work
8989 try {
90 - $result = $maintenance->execute();
 90+ $maintenance->execute();
9191 } catch( MWException $mwe ) {
9292 echo( $mwe->getText() );
93 - $result = 1;
9493 }
9594
9695 // Potentially debug globals
9796 $maintenance->globals();
98 -
99 -exit( intval( $result ) );
Index: trunk/phase3/maintenance/Maintenance.php
@@ -232,7 +232,7 @@
233233 fwrite( $f, $err . "\n" );
234234 fclose( $f );
235235 }
236 - if( $die ) exit( 1 );
 236+ if( $die ) die();
237237 }
238238
239239 /**
Index: trunk/phase3/RELEASE-NOTES
@@ -258,7 +258,6 @@
259259 the parser so extensions are free to implement their own <math> tag
260260 * (bug 21047) Wrap 'cannotdelete' into a div with the generic 'error' class and
261261 an own 'mw-error-cannotdelete' class
262 -* Maintenance scripts now set nonzero exit codes when terminating due to error
263262
264263 === Bug fixes in 1.16 ===
265264

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r58033Set a nonzero exit status in case of maintenance script failuremaxsem18:47, 22 October 2009

Comments

#Comment by Platonides (talk | contribs)   21:53, 22 October 2009

The problem was the exit( intval( $result ) ); Maintenance scripts begin by including require_once( "$IP/maintenance/commandLine.inc" ); whose last action is require( DO_MAINTENANCE ); (doMaintenance.php), which with r58033 ended the whole php instance. The change at Maintenance.php should be enough since a failing script should call ->error(), and all scripts follow the right conventions, right? :)

Status & tagging log