User "Happy-melon" posted a comment on MediaWiki.r85918.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/85918#c17715
Commit summary:

Improvements to handling of 'catastrophic' errors, like unsupported PHP 
versions, no MySQL functions, no LocalSettings, etc.
* Fix parsing of the three major entry points (index.php, api.php, load.php) 
back to PHP 4.4.9.  We don't care what happens if you actually try to run these 
files on old versions, but the entry files need to parse correctly.
* consign /includes/templates/PHP4.php and 
/includes/templates/NoLocalSettings.php to the fiery pit of hell where they 
belong.
* Prevent loading of any other files for PHP < 5.  WebStart.php was rendered 
unparseable in PHP 4 by the introduction of try/catch blocks in r85327.
* Die outright with a pretty error message on PHP < 5.2.3 as well as PHP 4.  
All versions of PHP below that throw parse errors of various sorts.
* Reimplement wfDie() to provide an entry-point-dependent 
die-with-readable-error-message function (for instance, we want a pretty 
human-readable page in index.php, something wrapped in CSS/JS /*...*/ comment 
block in load.php, etc).
* Standardise the appearance of the catastrophic errors thrown at the top of 
the stack with the ones lower down (exception-within-exception, etc).  There 
isn't really a way to do this without duplication, AFAICT.

Comment:

Certainly pretty much ''all'' errors should be triggered by raising an 
exception.  The use of wfDie() is to define what ''the exception'' should do 
with it.  Before, IIRC, exceptions triggered in load.php outputted HTML into 
what should be a CSS/JS environment, for instance, because Exception.php didn't 
know what context it was echoing into (still doesn't, for that matter).  The 
uses of wfDie() in Exception.php are not old junk, they're ''brand new'' in 
this revision.

How does wfDie() have "different meanings depending on the context"?  wfDie() 
means "I can't handle this any more, get me out of here"; in a fashion which is 
entry-point-dependent, doesn't require access to the autoloader, and preferably 
which works on as many environments as possible, such as PHP4.

_______________________________________________
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to