r74167 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74166‎ | r74167 | r74168 >
Date:22:22, 2 October 2010
Author:siebrand
Status:ok (Comments)
Tags:
Comment:
Remove some references to no longer supported PHP version.

Also add a FIXME for a check in DefaultSettings.php and fix indentation in install-utils.inc.
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/WebStart.php (modified) (history)
  • /trunk/phase3/includes/templates/PHP4.php (modified) (history)
  • /trunk/phase3/maintenance/Maintenance.php (modified) (history)
  • /trunk/phase3/maintenance/install-utils.inc (modified) (history)
  • /trunk/phase3/php5.php5 (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/Maintenance.php
@@ -15,11 +15,12 @@
1616 }
1717
1818 // Make sure we're on PHP5 or better
19 -if ( version_compare( PHP_VERSION, '5.0.0' ) < 0 ) {
20 - die ( "Sorry! This version of MediaWiki requires PHP 5; you are running " .
 19+if ( version_compare( PHP_VERSION, '5.1.0' ) < 0 ) {
 20+ die ( "Sorry! This version of MediaWiki requires PHP 5.1.x; you are running " .
2121 PHP_VERSION . ".\n\n" .
22 - "If you are sure you already have PHP 5 installed, it may be installed\n" .
23 - "in a different path from PHP 4. Check with your system administrator.\n" );
 22+ "If you are sure you already have PHP 5.1.x or higher installed, it may be\n" .
 23+ "installed in a different path from PHP " . PHP_VERSION . ". Check with your system\n" .
 24+ "administrator.\n" );
2425 }
2526
2627 /**
Index: trunk/phase3/maintenance/install-utils.inc
@@ -19,8 +19,8 @@
2020 }
2121 if ( version_compare( phpversion(), '5.1.0' ) < 0 ) {
2222 echo "PHP 5.1.0 or higher is required. If PHP 5 is available only when \n" .
23 - "PHP files have a .php5 extension, please navigate to <a href=\"index.php5\">index.php5</a> \n" .
24 - "to continue installation. ABORTING.\n";
 23+ "PHP files have a .php5 extension, please navigate to <a href=\"index.php5\">index.php5</a> \n" .
 24+ "to continue installation. ABORTING.\n";
2525 die( 1 );
2626 }
2727
Index: trunk/phase3/php5.php5
@@ -4,6 +4,6 @@
55 * Test for *.php5 capability in webserver
66 * Used by includes/templates/PHP4.php
77 */
8 -if ( version_compare( phpversion(), '5.0.0' ) >= 0 ) {
 8+if ( version_compare( phpversion(), '5.1.0' ) >= 0 ) {
99 echo 'y'.'e'.'s';
1010 }
Index: trunk/phase3/includes/Article.php
@@ -4492,7 +4492,6 @@
44934493 }
44944494
44954495 # Get the diff
4496 - # Note that we simulate array_diff_key in PHP <5.0.x
44974496 $templates_diff = array_diff_key( $poTemplates, $tlTemplates );
44984497
44994498 if ( count( $templates_diff ) > 0 ) {
Index: trunk/phase3/includes/GlobalFunctions.php
@@ -16,7 +16,7 @@
1717 /**
1818 * Compatibility functions
1919 *
20 - * We more or less support PHP 5.0.x and up.
 20+ * We support PHP 5.1.x and up.
2121 * Re-implementations of newer functions or functions in non-standard
2222 * PHP extensions may be included here.
2323 */
Index: trunk/phase3/includes/WebStart.php
@@ -89,16 +89,6 @@
9090 exit;
9191 }
9292
93 -# Test for PHP bug which breaks PHP 5.0.x on 64-bit...
94 -# As of 1.8 this breaks lots of common operations instead
95 -# of just some rare ones like export.
96 -$borked = str_replace( 'a', 'b', array( -1 => -1 ) );
97 -if( !isset( $borked[-1] ) ) {
98 - echo "PHP 5.0.x is buggy on your 64-bit system; you must upgrade to PHP 5.1.x\n" .
99 - "or higher. ABORTING. (http://bugs.php.net/bug.php?id=34879 for details)\n";
100 - exit;
101 -}
102 -
10393 # Start the autoloader, so that extensions can derive classes from core files
10494 require_once( "$IP/includes/AutoLoader.php" );
10595
Index: trunk/phase3/includes/DefaultSettings.php
@@ -3778,6 +3778,8 @@
37793779 /**
37803780 * Regexp to match word boundaries, defaults for non-CJK languages
37813781 * should be empty for CJK since the words are not separate
 3782+ *
 3783+ * @todo FIXME: checks for lower than required PHP version (5.1.x).
37823784 */
37833785 $wgSearchHighlightBoundaries = version_compare("5.1", PHP_VERSION, "<")? '[\p{Z}\p{P}\p{C}]'
37843786 : '[ ,.;:!?~!@#$%\^&*\(\)+=\-\\|\[\]"\'<>\n\r\/{}]'; // PHP 5.0 workaround
Index: trunk/phase3/includes/templates/PHP4.php
@@ -58,7 +58,7 @@
5959 <h1>MediaWiki <?php echo htmlspecialchars( $wgVersion ); ?></h1>
6060 <div class='error'>
6161 <p>
62 - MediaWiki requires PHP 5.0.0 or higher. You are running PHP
 62+ MediaWiki requires PHP 5.1.x or higher. You are running PHP
6363 <?php echo htmlspecialchars( phpversion() ); ?>.
6464 </p>
6565 <?php

Comments

#Comment by Nikerabbit (talk | contribs)   07:04, 3 October 2010

I think we should keep the check in WebStart.php, it's been finding the same bug in other versions too. The error message should be changed though.

#Comment by Siebrand (talk | contribs)   08:38, 3 October 2010

Any bug reports in the PHP tracker for that? http://bugs.php.net/bug.php?id=34879 has been closed for the past five years.

#Comment by Nikerabbit (talk | contribs)   08:41, 3 October 2010

None that I am aware of. But since the PHP developers don't seem to have a regression suite it seems to have been reintroduced in some minor versions that can still be out there.

Status & tagging log