From 31796b6a98e02c42b8ed023840748bd9e125cbe2 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 15 Jan 2010 01:29:55 +0000 Subject: [PATCH] PHP 5.3.2 might not be out until February, by which time a number of distros will probably be using PHP 5.3.1. Replacing the version number check with a direct bug #50394 check, so that distros or other users can backport the one-line fix without having to upgrade to 5.3.2. --- config/Installer.php | 7 ------- maintenance/install-utils.inc | 28 ++++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/config/Installer.php b/config/Installer.php index c718aff737..b0739b13c9 100644 --- a/config/Installer.php +++ b/config/Installer.php @@ -419,13 +419,6 @@ if( wfIniGetBool( "zend.ze1_compatibility_mode" ) ) {
  • Fatal: PHP 5.3.1 is not compatible with MediaWiki! - PHP 5.3.1 is not compatible with MediaWiki due to a bug in PHP. Please use PHP 5.3.0, or PHP 5.3.2 or later.
  • - index.php5 \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 ) ) { -- 2.20.1