r61480 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61479‎ | r61480 | r61481 >
Date:04:59, 25 January 2010
Author:tstarling
Status:ok
Tags:
Comment:
Made the bug #21793 test only check for the PHP 5.3.x version of the bug, and allow the PHP 5.2.x version. There isn't actually any reported MW bug arising from the 5.2.x version at this time.
Modified paths:
  • /trunk/phase3/maintenance/install-utils.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/install-utils.inc
@@ -44,17 +44,15 @@
4545 }
4646
4747 $test = new PhpRefCallBugTester;
48 - $ok = false;
49 - call_user_func_array( array( $test, 'test' ), array( &$ok ) );
50 - if ( !$ok ) {
51 - echo "PHP 5.2.11, 5.2.12, and 5.3.1 (your version: " . phpversion() . ") are not compatible with\n" .
52 - "MediaWiki due to a bug involving reference parameters to __call. Upgrade to\n" .
53 - "PHP 5.3.2 (5.2.13 for 5.2 users), or downgrade to PHP 5.3.0 (5.2.10 for 5.2\n" .
54 - "users) to fix this. ABORTING (see http://bugs.php.net/bug.php?id=50394 for details)\n";
 48+ $test->execute();
 49+ if ( !$test->ok ) {
 50+ echo "PHP 5.3.1 is not compatible with MediaWiki due to a bug involving\n" .
 51+ "reference parameters to __call. Upgrade to PHP 5.3.2 or higher, or \n" .
 52+ "downgrade to PHP 5.3.0 to fix this.\n" .
 53+ "ABORTING (see http://bugs.php.net/bug.php?id=50394 for details)\n";
5554 die( 1 );
5655 }
5756
58 -
5957 global $wgCommandLineMode;
6058 $wgCommandLineMode = true;
6159 umask( 000 );
@@ -84,12 +82,27 @@
8583 }
8684
8785 /**
88 - * Test for PHP bug #50394
 86+ * Test for PHP bug #50394 (PHP 5.3.x conversion to null only, not 5.2.x)
8987 */
9088 class PhpRefCallBugTester {
 89+ public $ok = false;
 90+
9191 function __call( $name, $args ) {
92 - $args[0] = true;
 92+ $old = error_reporting( E_ALL & ~E_WARNING );
 93+ call_user_func_array( array( $this, 'checkForBrokenRef' ), $args );
 94+ error_reporting( $old );
9395 }
 96+
 97+ function checkForBrokenRef( &$var ) {
 98+ if ( $var ) {
 99+ $this->ok = true;
 100+ }
 101+ }
 102+
 103+ function execute() {
 104+ $var = true;
 105+ call_user_func_array( array( $this, 'foo' ), array( &$var ) );
 106+ }
94107 }
95108
96109 function readconsole( $prompt = '' ) {

Status & tagging log