PHP 5.3.2 might not be out until February, by which time a number of distros will...
authorTim Starling <tstarling@users.mediawiki.org>
Fri, 15 Jan 2010 01:29:55 +0000 (01:29 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Fri, 15 Jan 2010 01:29:55 +0000 (01:29 +0000)
config/Installer.php
maintenance/install-utils.inc

index c718aff..b0739b1 100644 (file)
@@ -419,13 +419,6 @@ if( wfIniGetBool( "zend.ze1_compatibility_mode" ) ) {
        <?php
 }
 
-if( phpversion() === '5.3.1' ) {
-       $fatal = true;
-       ?><li class="error"><strong>Fatal: PHP 5.3.1 is not compatible with MediaWiki!</strong>
-       PHP 5.3.1 is not compatible with MediaWiki due to a <a href="http://news.php.net/php.internals/46389">bug in PHP</a>. Please use PHP 5.3.0, or PHP 5.3.2 or later.</li>
-       <?php
-}
-
 if( $fatal ) {
        dieout( "Cannot install MediaWiki." );
 }
index 565d02e..1919e8c 100644 (file)
@@ -15,13 +15,13 @@ function install_version_checks() {
        if( !function_exists( 'version_compare' ) ) {
                # version_compare was introduced in 4.1.0
                echo "Your PHP version is much too old; 4.0.x will _not_ work. 5.0.0 or higher is required. ABORTING.\n";
-               die( -1 );
+               die( 1 );
        }
        if( version_compare( phpversion(), '5.0.0' ) < 0 ) {
                echo "PHP 5.0.0 or higher is required. If PHP 5 is available only when \n".
    "PHP files have a .php5 extension, please navigate to <a href=\"index.php5\">index.php5</a> \n".
    "to continue installation. ABORTING.\n";
-               die( -1 );
+               die( 1 );
        }
 
        // Test for PHP bug which breaks PHP 5.0.x on 64-bit...
@@ -31,7 +31,7 @@ function install_version_checks() {
        if( !isset( $borked[-1] ) ) {
                echo "PHP 5.0.x is buggy on your 64-bit system; you must upgrade to PHP 5.1.x\n" .
                        "or higher. ABORTING. (http://bugs.php.net/bug.php?id=34879 for details)\n";
-               die( -1 );
+               die( 1 );
        }
 
        $test = new PhpXmlBugTester();
@@ -40,7 +40,18 @@ function install_version_checks() {
                        "and can cause hidden data corruption in MediaWiki and other web apps.\n" .
                        "Upgrade to PHP 5.2.9 or later and libxml2 2.7.3 or later!\n" .
                        "ABORTING (http://bugs.php.net/bug.php?id=45996 for details).\n";
-               die( -1 );
+               die( 1 );
+       }
+
+       $test = new PhpRefCallBugTester;
+       $ok = false;
+       call_user_func_array( array( $test, 'test' ), array( &$ok ) );
+       if ( !$ok ) {
+               echo "PHP 5.3.1 is not compatible with MediaWiki due to a bug involving\n" .
+                       "reference parameters to __call. Upgrade to PHP 5.3.2, or downgrade\n" .
+                       "to PHP 5.3.0 to fix this.\n" .
+                       "ABORTING (see http://bugs.php.net/bug.php?id=50394 for details)\n";
+               die( 1 );
        }
 
 
@@ -72,6 +83,15 @@ class PhpXmlBugTester {
        }
 }
 
+/**
+ * Test for PHP bug #50394
+ */
+class PhpRefCallBugTester {
+       function __call( $name, $args ) {
+               $args[0] = true;
+       }
+}
+
 function readconsole( $prompt = '' ) {
        static $isatty = null;
        if ( is_null( $isatty ) ) {