Installer: Remove two environmental checks
authorKevin Israel <pleasestand@live.com>
Wed, 22 Jan 2014 22:23:09 +0000 (17:23 -0500)
committerKevin Israel <pleasestand@live.com>
Thu, 23 Jan 2014 00:41:19 +0000 (19:41 -0500)
* envCheckPHP531: Message is outdated ("downgrade to 5.3.0"; the
  current minimum PHP version is 5.3.2), and PHP Bug #50394 has
  not reappeared in any later version.
* envCheckZE1: zend.ze1_compatibility_mode was removed in 5.3.0.

Also updated the error message for envCheckBrokenXML to remove
the "Upgrade to PHP 5.2.9 or later" wording.

Change-Id: Ifc8754151dd23a0314c6739cb78c7ac61a306bc4

includes/AutoLoader.php
includes/installer/Installer.i18n.php
includes/installer/Installer.php
includes/installer/PhpBugTests.php
maintenance/update.php

index a7ac139..6d65a82 100644 (file)
@@ -609,7 +609,6 @@ $wgAutoloadLocalClasses = array(
        'MysqlUpdater' => 'includes/installer/MysqlUpdater.php',
        'OracleInstaller' => 'includes/installer/OracleInstaller.php',
        'OracleUpdater' => 'includes/installer/OracleUpdater.php',
-       'PhpRefCallBugTester' => 'includes/installer/PhpBugTests.php',
        'PhpXmlBugTester' => 'includes/installer/PhpBugTests.php',
        'PostgresInstaller' => 'includes/installer/PostgresInstaller.php',
        'PostgresUpdater' => 'includes/installer/PostgresUpdater.php',
index cbd9af2..69fd6a3 100644 (file)
@@ -115,9 +115,6 @@ This option corrupts data input unpredictably.
 You cannot install or use MediaWiki unless this option is disabled.",
        'config-mbstring'                 => "'''Fatal: [http://www.php.net/manual/en/ref.mbstring.php#mbstring.overload mbstring.func_overload] is active!'''
 This option causes errors and may corrupt data unpredictably.
-You cannot install or use MediaWiki unless this option is disabled.",
-       'config-ze1'                      => "'''Fatal: [http://www.php.net/manual/en/ini.core.php zend.ze1_compatibility_mode] is active!'''
-This option causes horrible bugs with MediaWiki.
 You cannot install or use MediaWiki unless this option is disabled.",
        'config-safe-mode'                => "'''Warning:''' PHP's [http://www.php.net/features.safe-mode safe mode] is active.
 It may cause problems, particularly if using file uploads and <code>math</code> support.",
@@ -163,11 +160,8 @@ Installation aborted.",
 Although MediaWiki checks all uploaded files for security threats, it is highly recommended to [//www.mediawiki.org/wiki/Manual:Security#Upload_security close this security vulnerability] before enabling uploads.",
        'config-no-cli-uploads-check'     => "'''Warning:''' Your default directory for uploads (<code>$1</code>) is not checked for vulnerability
 to arbitrary script execution during the CLI install.",
-       'config-brokenlibxml'             => 'Your system has a combination of PHP and libxml2 versions which is buggy and can cause hidden data corruption in MediaWiki and other web applications.
-Upgrade to PHP 5.2.9 or later and libxml2 2.7.3 or later ([//bugs.php.net/bug.php?id=45996 bug filed with PHP]).
-Installation aborted.',
-       'config-using531'                 => 'MediaWiki cannot be used with PHP $1 due to a bug involving reference parameters to <code>__call()</code>.
-Upgrade to PHP 5.3.2 or higher, or downgrade to PHP 5.3.0 to resolve this.
+       'config-brokenlibxml'             => 'Your system has a combination of PHP and libxml2 versions that is buggy and can cause hidden data corruption in MediaWiki and other web applications.
+Upgrade to libxml2 2.7.3 or later ([https://bugs.php.net/bug.php?id=45996 bug filed with PHP]).
 Installation aborted.',
        'config-suhosin-max-value-length' => "Suhosin is installed and limits the GET parameter <code>length</code> to $1 bytes.
 MediaWiki's ResourceLoader component will work around this limit, but that will degrade performance.
index 9fbf088..8b15f0c 100644 (file)
@@ -116,11 +116,9 @@ abstract class Installer {
                'envCheckDB',
                'envCheckRegisterGlobals',
                'envCheckBrokenXML',
-               'envCheckPHP531',
                'envCheckMagicQuotes',
                'envCheckMagicSybase',
                'envCheckMbstring',
-               'envCheckZE1',
                'envCheckSafeMode',
                'envCheckXML',
                'envCheckPCRE',
@@ -734,23 +732,6 @@ abstract class Installer {
                return true;
        }
 
-       /**
-        * Test PHP (probably 5.3.1, but it could regress again) to make sure that
-        * reference parameters to __call() are not converted to null
-        * @return bool
-        */
-       protected function envCheckPHP531() {
-               $test = new PhpRefCallBugTester;
-               $test->execute();
-               if ( !$test->ok ) {
-                       $this->showError( 'config-using531', phpversion() );
-
-                       return false;
-               }
-
-               return true;
-       }
-
        /**
         * Environment check for magic_quotes_runtime.
         * @return bool
@@ -793,20 +774,6 @@ abstract class Installer {
                return true;
        }
 
-       /**
-        * Environment check for zend.ze1_compatibility_mode.
-        * @return bool
-        */
-       protected function envCheckZE1() {
-               if ( wfIniGetBool( 'zend.ze1_compatibility_mode' ) ) {
-                       $this->showError( 'config-ze1' );
-
-                       return false;
-               }
-
-               return true;
-       }
-
        /**
         * Environment check for safe_mode.
         * @return bool
index 5471264..0460134 100644 (file)
@@ -45,29 +45,3 @@ class PhpXmlBugTester {
                $this->parsedData .= $data;
        }
 }
-
-/**
- * Test for PHP bug #50394 (PHP 5.3.x conversion to null only, not 5.2.x)
- * @see http://bugs.php.net/bug.php?id=50394
- * @ingroup PHPBugTests
- */
-class PhpRefCallBugTester {
-       public $ok = false;
-
-       function __call( $name, $args ) {
-               $old = error_reporting( E_ALL & ~E_WARNING );
-               call_user_func_array( array( $this, 'checkForBrokenRef' ), $args );
-               error_reporting( $old );
-       }
-
-       function checkForBrokenRef( &$var ) {
-               if ( $var ) {
-                       $this->ok = true;
-               }
-       }
-
-       function execute() {
-               $var = true;
-               call_user_func_array( array( $this, 'foo' ), array( &$var ) );
-       }
-}
index ea3133c..85364ee 100644 (file)
@@ -74,22 +74,10 @@ class UpdateMediaWiki extends Maintenance {
                $test = new PhpXmlBugTester();
                if ( !$test->ok ) {
                        $this->error(
-                               "Your system has a combination of PHP and libxml2 versions which is buggy\n" .
+                               "Your system has a combination of PHP and libxml2 versions that is buggy\n" .
                                "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 (see http://bugs.php.net/bug.php?id=45996).\n",
-                               true );
-               }
-
-               $test = new PhpRefCallBugTester;
-               $test->execute();
-               if ( !$test->ok ) {
-                       $ver = phpversion();
-                       $this->error(
-                               "PHP $ver is not compatible with MediaWiki due to a bug involving\n" .
-                               "reference parameters to __call. Upgrade to PHP 5.3.2 or higher, or \n" .
-                               "downgrade to PHP 5.3.0 to fix this.\n" .
-                               "ABORTING (see http://bugs.php.net/bug.php?id=50394 for details)\n",
+                               "Upgrade to libxml2 2.7.3 or later.\n" .
+                               "ABORTING (see https://bugs.php.net/bug.php?id=45996).\n",
                                true );
                }
        }