r63401 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63400‎ | r63401 | r63402 >
Date:17:42, 8 March 2010
Author:tstarling
Status:ok
Tags:
Comment:
Backported the check for PHP 5.3.1 to REL1_15.
Modified paths:
  • /branches/REL1_15/phase3/RELEASE-NOTES (modified) (history)
  • /branches/REL1_15/phase3/install-utils.inc (modified) (history)

Diff [purge]

Index: branches/REL1_15/phase3/install-utils.inc
@@ -44,6 +44,16 @@
4545 }
4646
4747
 48+ $test = new PhpRefCallBugTester;
 49+ $test->execute();
 50+ if ( !$test->ok ) {
 51+ echo "PHP 5.3.1 is not compatible with MediaWiki due to a bug involving\n" .
 52+ "reference parameters to __call. Upgrade to PHP 5.3.2 or higher, or \n" .
 53+ "downgrade to PHP 5.3.0 to fix this.\n" .
 54+ "ABORTING (see http://bugs.php.net/bug.php?id=50394 for details)\n";
 55+ die( -1 );
 56+ }
 57+
4858 global $wgCommandLineMode;
4959 $wgCommandLineMode = true;
5060 umask( 000 );
@@ -101,6 +111,30 @@
102112 }
103113 }
104114
 115+/**
 116+ * Test for PHP bug #50394 (PHP 5.3.x conversion to null only, not 5.2.x)
 117+ */
 118+class PhpRefCallBugTester {
 119+ public $ok = false;
 120+
 121+ function __call( $name, $args ) {
 122+ $old = error_reporting( E_ALL & ~E_WARNING );
 123+ call_user_func_array( array( $this, 'checkForBrokenRef' ), $args );
 124+ error_reporting( $old );
 125+ }
 126+
 127+ function checkForBrokenRef( &$var ) {
 128+ if ( $var ) {
 129+ $this->ok = true;
 130+ }
 131+ }
 132+
 133+ function execute() {
 134+ $var = true;
 135+ call_user_func_array( array( $this, 'foo' ), array( &$var ) );
 136+ }
 137+}
 138+
105139 function readconsole( $prompt = '' ) {
106140 static $isatty = null;
107141 if ( is_null( $isatty ) ) {
Index: branches/REL1_15/phase3/RELEASE-NOTES
@@ -18,8 +18,9 @@
1919
2020 === Changes since 1.15.1 ===
2121
22 -* Installer now includes a check for a data corruption issue with certain
23 - versions of libxml2 2.7 and PHP earlier than 5.2.9.
 22+* The installer now includes a check for a data corruption issue with certain
 23+ versions of libxml2 2.7 and PHP earlier than 5.2.9, and also for a PHP bug
 24+ present in the official release of PHP 5.3.1.
2425 * (bug 20239) MediaWiki:Imagemaxsize does not contain anymore a <br /> tag which
2526 was displayed to the user
2627 * (bug 21150) SQLite no longer raise an error when deleting files

Status & tagging log