Make update.php and install.php use wfPHPVersionError() and reorganise it
authorPlatonides <platonides@gmail.com>
Tue, 26 Feb 2013 20:55:06 +0000 (21:55 +0100)
committerPlatonides <platonides@gmail.com>
Tue, 26 Feb 2013 20:55:06 +0000 (21:55 +0100)
commit32139b0ddf98ca622a2a1c930fe812a820fa5c5a
tree63ab9832d771f68182095104ac8612492593096d
parent55e8388137a826a7e7e5d259a95bc0a984eb35c2
Make update.php and install.php use wfPHPVersionError() and reorganise it

update.php and install.php now use wfPHPVersionError()

Moved to wfPHPVersionError( cli ) the suggestion of another binary name.

Old PHP versions won't have $_SERVER superglobal, hardcode HTTP/1.0 in that case.

Store in a variable the minimum version of PHP supported by MediaWiki.

Changed PHP_VERSION to phpversion(), although it doesn't matter for the version
ranges this works.

phpversion() has been present since PHP-2.0
PHP_VERSION was added in PHP 3.0RC5

On its current form in PHP 4 it was moved from Zend/zend_constants.c
to main/main.c by Zeev in commits 71dddd7db7e768ae8145e085fcbb6b6db4a1c40a and
fb1c77bd4f8a636ba47d720f8ca65fc6baae836d (1999-12-17)
It had been commented there since the beginning of svn history (1999-04-07)

The earliest version we can target seems to be PHP 4.1.0
PHP 4.0.0 produces a parse error on a require_once not followed by a literal
path (although you can use require with an expression), plus its dirname()
is quite dumb, and wouldn't provide the right path (would require you to call
"php ./update.php" from maintenance folder, not "php update.php" or
"php maintenance/update.php" from the main dir)

Replacing pathinfo( $_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME ); into a pathinfo()
to another variable since pathinfo( "", PATHINFO_DIRNAME ); core dumps in PHP 4.1.0
(works if $path is not empty)

The value of the pragma directive is 'no-cache', not 'nocache'. See section 14.32
of rfc2616: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.32

Change-Id: I6294e86a5f3e11b9ea0f62762815e7c71b9037ce
includes/PHPVersionError.php
maintenance/install.php
maintenance/update.php