[MediaWiki-CodeReview] [MediaWiki r85918]: New comment added

2011-06-07 Thread MediaWiki Mail
User "Brion VIBBER" posted a comment on MediaWiki.r85918.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/85918#c17828
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:

Poop. My vote then goes towards just killing all the PHP 4 stuff and 
documenting 'if you get parse errors, it's cause you're running year-2000 tech 
still, upgrade silly' :D

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


[MediaWiki-CodeReview] [MediaWiki r85918]: New comment added

2011-06-07 Thread MediaWiki Mail
User "Happy-melon" posted a comment on MediaWiki.r85918.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/85918#c17826
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:

That's exactly what I did!  But as Tim's pointed out elsewhere, most uses of 
require() breaks HipHop unless it's run through MWInit::compiledPath(), and you 
can't get that without loading WebStart, which is not PHP4-compatible...  
:(  So you can't really move very much of what's in index.php deeper 
into the callstack, because you still have to leave enough infrastructure to be 
able to correctly find the deeper file.

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


[MediaWiki-CodeReview] [MediaWiki r85918]: New comment added

2011-06-07 Thread MediaWiki Mail
User "Tim Starling" posted a comment on MediaWiki.r85918.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/85918#c17819
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:

Sounds good. Can you also rename the MediaWiki class to MainEntry or something 
while you're at it? It's always been a helper for index.php, and has very 
little to do with the rest of MediaWiki.

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


[MediaWiki-CodeReview] [MediaWiki r85918]: New comment added

2011-06-07 Thread MediaWiki Mail
User "Platonides" posted a comment on MediaWiki.r85918.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/85918#c17818
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:

I had already looked at wfIndexMain(), I think it should be pieced and moved 
into MediaWiki class. Also, it is broken for $wgArticle currently.

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


[MediaWiki-CodeReview] [MediaWiki r85918]: New comment added

2011-06-07 Thread MediaWiki Mail
User "Brion VIBBER" posted a comment on MediaWiki.r85918.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/85918#c17817
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:

I'd say let's either drop the PHP 4 checks entirely, or move the actual code 
out of the entry points and require() through to the 'real' code, so we don't 
all keep accidentally checking things in that break the PHP 4 parser. :)


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


[MediaWiki-CodeReview] [MediaWiki r85918]: New comment added

2011-06-07 Thread MediaWiki Mail
User "Platonides" posted a comment on MediaWiki.r85918.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/85918#c17816
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:

> I'm pretty sure I broke PHP 4 parsing in r88959.

You did 
[http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/index.php?r1=88958&r2=88959].
 PHP 4 doesn't like try/catch.

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


[MediaWiki-CodeReview] [MediaWiki r85918]: New comment added

2011-06-07 Thread MediaWiki Mail
User "Tim Starling" posted a comment on MediaWiki.r85918.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/85918#c17815
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:

Well yeah, specifically, documenting the fact that parse errors mean you have 
to upgrade to PHP 5 and leaving it at that. The reason I did some work on PHP 4 
error messages in r41713 is because we were having support requests from people 
who didn't know what the parse errors meant.

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


[MediaWiki-CodeReview] [MediaWiki r85918]: New comment added

2011-06-07 Thread MediaWiki Mail
User "^demon" posted a comment on MediaWiki.r85918.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/85918#c17730
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:

The other option is forgetting about PHP4.

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


[MediaWiki-CodeReview] [MediaWiki r85918]: New comment added

2011-06-07 Thread MediaWiki Mail
User "Tim Starling" posted a comment on MediaWiki.r85918.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/85918#c17725
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:

I suggest restoring wfDie() back to how it was before, and thinking of a new 
name for what you want to do.

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


[MediaWiki-CodeReview] [MediaWiki r85918]: New comment added

2011-06-07 Thread MediaWiki Mail
User "Tim Starling" posted a comment on MediaWiki.r85918.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/85918#c17724
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:

I thought I documented it already, at [[HipHop#Declarations]]. Let me know if 
there's something unclear about that page. 

No, it won't work. One thing that would work would be to have a set of 
exception formatting classes in an autoloaded class file, then set the class 
name to use via a constant, global variable or static member accessor function 
like Exception::setFormattingClass(). That won't work for PHP 4, but I'm pretty 
sure I broke PHP 4 parsing in r88959. So maybe some more robust solution is 
needed for PHP 4, like say moving the bulk of the code out of the entry points 
and restoring PHP4.php. 

PHP4.php was better than what you have here anyway, since it was able to detect 
the situation where a .php5 extension will work. Or at least it did until the 
entry points were broken again.

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


[MediaWiki-CodeReview] [MediaWiki r85918]: New comment added

2011-06-07 Thread MediaWiki Mail
User "Happy-melon" posted a comment on MediaWiki.r85918.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/85918#c17717
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:

It would be helpful if this, like the other issues affecting HipHop support, 
could be documented at [[HipHop]] or somesuch.  What ''is'' the way to achieve 
this?  Would a structure like 

// load.php
define( 'MW_ENTRY_POINT', 'LOAD' );

...

if( MW_ENTRY_POINT == 'LOAD' ) {
function wfDie( $msg ){ ... }
}
 
Work?

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


[MediaWiki-CodeReview] [MediaWiki r85918]: New comment added

2011-06-07 Thread MediaWiki Mail
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


[MediaWiki-CodeReview] [MediaWiki r85918]: New comment added

2011-06-06 Thread MediaWiki Mail
User "Tim Starling" posted a comment on MediaWiki.r85918.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/85918#c17709
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:

In most places where you might want to use this new variant of wfDie(), you can 
throw an exception instead. Exceptions already have the infrastructure for 
formatting error messages in various ways depending on the entry point. If 
there's some problem with that infrastructure, then it should be fixed rather 
than duplicated.

The old uses of wfDie() are just a shortcut for "echo $msg;die(-1);", they 
reflect Brion's disgust at PHP when he found out that die($msg) doesn't do 
that. See r12660. I removed most instances from the core in r14631 in favour of 
exceptions.

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


[MediaWiki-CodeReview] [MediaWiki r85918]: New comment added

2011-06-06 Thread MediaWiki Mail
User "^demon" posted a comment on MediaWiki.r85918.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/85918#c17708
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:

I had already noticed this, I just hadn't worked on a fix for it yet. To be 
honest, I don't really like this approach at all. wfDie() means very different 
things, depending on the context.
* Dying in maintenance scripts - New maintenance scripts can just use error() 
with the second parameter. Older ones should be updated to subclass Maintenance 
anyway.
* Catastrophic errors like PHP version too low, API disabled, or missing 
LocalSettings.
* Some old junk in Exception.php
Since wfDie() isn't used outside of core '''anywhere''', I'd suggest we just 
remove it entirely or at least severely limit the use-cases.

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


[MediaWiki-CodeReview] [MediaWiki r85918]: New comment added, and revision status changed

2011-06-06 Thread MediaWiki Mail
User "Tim Starling" changed the status of MediaWiki.r85918.

Old Status: new
New Status: fixme

User "Tim Starling" also posted a comment on MediaWiki.r85918.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/85918#c17707
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:

Appears to break HipHop support. Please do not define multiple functions with 
the same name, even if they are in different files. There are lots of other 
ways to do this.

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


[MediaWiki-CodeReview] [MediaWiki r85918]: New comment added, and revision status changed

2011-05-07 Thread MediaWiki Mail
User "Happy-melon" changed the status of MediaWiki.r85918.

Old Status: fixme
New Status: new

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

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/85918#c16662
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:

Fixed in r87628.

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


[MediaWiki-CodeReview] [MediaWiki r85918]: New comment added, and revision status changed

2011-05-05 Thread MediaWiki Mail
User "Brion VIBBER" changed the status of MediaWiki.r85918.

Old Status: new
New Status: fixme

User "Brion VIBBER" also posted a comment on MediaWiki.r85918.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/85918#c16607
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:

Appears to have caused bug 28834 with the change to Exception.php's 
wfReportException() removing an nl2br() call and thus removing line breaks from 
the exception stack trace.


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