r88176 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88175‎ | r88176 | r88177 >
Date:13:21, 15 May 2011
Author:tstarling
Status:ok (Comments)
Tags:
Comment:
Revert r87635, r87637, r87639, r87643 (MW_MIN_PHP_VERSION etc.): breaks HipHop support.
Modified paths:
  • /trunk/phase3/api.php (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/Defines.php (modified) (history)
  • /trunk/phase3/includes/Export.php (modified) (history)
  • /trunk/phase3/includes/Feed.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/HttpFunctions.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/Setup.php (modified) (history)
  • /trunk/phase3/includes/installer/DatabaseUpdater.php (modified) (history)
  • /trunk/phase3/includes/installer/Installer.php (modified) (history)
  • /trunk/phase3/includes/installer/MysqlInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/OracleInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/WebInstallerOutput.php (modified) (history)
  • /trunk/phase3/includes/resourceloader/ResourceLoaderStartUpModule.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialVersion.php (modified) (history)
  • /trunk/phase3/index.php (modified) (history)
  • /trunk/phase3/load.php (modified) (history)
  • /trunk/phase3/maintenance/Maintenance.php (modified) (history)
  • /trunk/phase3/maintenance/install.php (modified) (history)
  • /trunk/phase3/maintenance/update.php (modified) (history)
  • /trunk/phase3/tests/parserTests.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/update.php
@@ -25,12 +25,8 @@
2626 * @ingroup Maintenance
2727 */
2828
29 -// Include global constants, including MW_VERSION and MW_MIN_PHP_VERSION
30 -require_once( dirname( dirname( __FILE__ ) ) . '/includes/Defines.php' );
31 -
32 -if ( !function_exists( 'version_compare' ) || ( version_compare( phpversion(), MW_MIN_PHP_VERSION ) < 0 ) ) {
33 - echo "You are using PHP version " . phpversion() . " but MediaWiki needs PHP " .
34 - MW_MIN_PHP_VERSION . "or higher. ABORTING.\n" .
 29+if ( !function_exists( 'version_compare' ) || ( version_compare( phpversion(), '5.2.3' ) < 0 ) ) {
 30+ echo "You are using PHP version " . phpversion() . " but MediaWiki needs PHP 5.2.3 or higher. ABORTING.\n" .
3531 "Check if you have a newer php executable with a different name, such as php5.\n";
3632 die( 1 );
3733 }
Index: trunk/phase3/maintenance/install.php
@@ -20,13 +20,9 @@
2121 * @see wfWaitForSlaves()
2222 */
2323
24 -// Include global constants, including MW_VERSION and MW_MIN_PHP_VERSION
25 -require_once( dirname( dirname( __FILE__ ) ) . '/includes/Defines.php' );
26 -
27 -if ( !function_exists( 'version_compare' ) || ( version_compare( phpversion(), MW_MIN_PHP_VERSION ) < 0 ) ) {
28 - echo "You are using PHP version " . phpversion() . " but MediaWiki needs PHP " .
29 - MW_MIN_PHP_VERSION . " or higher. ABORTING.\n" .
30 - "Check if you have a newer php executable with a different name, such as php5.\n";
 24+if ( !function_exists( 'version_compare' ) || ( version_compare( phpversion(), '5.2.3' ) < 0 ) ) {
 25+ echo "You are using PHP version " . phpversion() . " but MediaWiki needs PHP 5.2.3 or higher. ABORTING.\n" .
 26+ "Check if you have a newer php executable with a different name, such as php5.\n";
3127 die( 1 );
3228 }
3329
Index: trunk/phase3/maintenance/Maintenance.php
@@ -20,9 +20,6 @@
2121 * @defgroup Maintenance Maintenance
2222 */
2323
24 -// Include global constants, including MW_VERSION and MW_MIN_PHP_VERSION
25 -require_once( dirname( dirname( __FILE__ ) ) . '/includes/Defines.php' );
26 -
2724 // Define this so scripts can easily find doMaintenance.php
2825 define( 'RUN_MAINTENANCE_IF_MAIN', dirname( __FILE__ ) . '/doMaintenance.php' );
2926 define( 'DO_MAINTENANCE', RUN_MAINTENANCE_IF_MAIN ); // original name, harmless
@@ -30,10 +27,10 @@
3128 $maintClass = false;
3229
3330 // Make sure we're on PHP5 or better
34 -if ( version_compare( PHP_VERSION, MW_MIN_PHP_VERSION ) < 0 ) {
35 - die ( "Sorry! This version of MediaWiki requires PHP " . MW_MIN_PHP_VERSION . "; you are running " .
 31+if ( version_compare( PHP_VERSION, '5.2.3' ) < 0 ) {
 32+ die ( "Sorry! This version of MediaWiki requires PHP 5.2.3; you are running " .
3633 PHP_VERSION . ".\n\n" .
37 - "If you are sure you already have PHP " . MW_MIN_PHP_VERSION . " or higher installed, it may be\n" .
 34+ "If you are sure you already have PHP 5.2.3 or higher installed, it may be\n" .
3835 "installed in a different path from PHP " . PHP_VERSION . ". Check with your system\n" .
3936 "administrator.\n" );
4037 }
Index: trunk/phase3/tests/parserTests.php
@@ -30,9 +30,8 @@
3131 require_once( dirname( __FILE__ ) . '/../maintenance/commandLine.inc' );
3232
3333 if ( isset( $options['help'] ) ) {
34 - $version = MW_VERSION;
3534 echo <<<ENDS
36 -MediaWiki $version parser test suite
 35+MediaWiki $wgVersion parser test suite
3736 Usage: php parserTests.php [options...]
3837
3938 Options:
Index: trunk/phase3/includes/Defines.php
@@ -1,8 +1,6 @@
22 <?php
33 /**
4 - * Global constants declarations. Do *NOT* include *anything* in this file which is
5 - * not a define() declaration; this file is included in all sorts of scopes and must
6 - * be parseable by PHP 4 without errors.
 4+ * A few constants that might be needed during LocalSettings.php.
75 *
86 * Note: these constants must all be resolvable at compile time by HipHop,
97 * since this file will not be executed during request startup for a compiled
@@ -11,23 +9,11 @@
1210 * @file
1311 */
1412
15 -/**@{
 13+/**
1614 * Version constants for the benefit of extensions
1715 */
18 -define( 'MW_VERSION', '1.19alpha' );
1916 define( 'MW_SPECIALPAGE_VERSION', 2 );
2017
21 -/**
22 - * Minimum version of PHP required to run; entry points will die
23 - * if they try to run on a version older than this
24 - */
25 -define( 'MW_MIN_PHP_VERSION', '5.2.3' );
26 -
27 -define( 'MW_MIN_MYSQL_VERSION', '4.0.14' );
28 -define( 'MW_MIN_ORACLE_VERSION', '9.0.1' );
29 -
30 -/**@}*/
31 -
3218 /**@{
3319 * Database related constants
3420 */
@@ -99,6 +85,16 @@
10086 define( 'NS_IMAGE_TALK', NS_FILE_TALK );
10187 /**@}*/
10288
 89+/**
 90+ * Available feeds objects
 91+ * Should probably only be defined when a page is syndicated ie when
 92+ * $wgOut->isSyndicated() is true
 93+ */
 94+$wgFeedClasses = array(
 95+ 'rss' => 'RSSFeed',
 96+ 'atom' => 'AtomFeed',
 97+);
 98+
10399 /**@{
104100 * Cache type
105101 */
Index: trunk/phase3/includes/GlobalFunctions.php
@@ -2500,8 +2500,10 @@
25012501 * a float
25022502 */
25032503 function wfUseMW( $req_ver ) {
2504 - if ( version_compare( MW_VERSION, (string)$req_ver, '<' ) ) {
2505 - throw new MWException( "MediaWiki $req_ver required--this is only " . MW_VERSION );
 2504+ global $wgVersion;
 2505+
 2506+ if ( version_compare( $wgVersion, (string)$req_ver, '<' ) ) {
 2507+ throw new MWException( "MediaWiki $req_ver required--this is only $wgVersion" );
25062508 }
25072509 }
25082510
Index: trunk/phase3/includes/Setup.php
@@ -23,7 +23,6 @@
2424 wfProfileIn( $fname );
2525
2626 // Check to see if we are at the file scope
27 -// FIXME: use a different test here, maybe a constant defined at the top of DefaultSettings.php?
2827 if ( !isset( $wgVersion ) ) {
2928 echo "Error, Setup.php must be included from the file scope, after DefaultSettings.php\n";
3029 die( 1 );
Index: trunk/phase3/includes/Feed.php
@@ -301,6 +301,7 @@
302302 * Ouput an RSS 2.0 header
303303 */
304304 function outHeader() {
 305+ global $wgVersion;
305306
306307 $this->outXmlHeader();
307308 ?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
@@ -309,7 +310,7 @@
310311 <link><?php print $this->getUrl() ?></link>
311312 <description><?php print $this->getDescription() ?></description>
312313 <language><?php print $this->getLanguage() ?></language>
313 - <generator>MediaWiki <?php print MW_VERSION ?></generator>
 314+ <generator>MediaWiki <?php print $wgVersion ?></generator>
314315 <lastBuildDate><?php print $this->formatTime( wfTimestampNow() ) ?></lastBuildDate>
315316 <?php
316317 }
@@ -360,6 +361,8 @@
361362 * Outputs a basic header for Atom 1.0 feeds.
362363 */
363364 function outHeader() {
 365+ global $wgVersion;
 366+
364367 $this->outXmlHeader();
365368 ?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="<?php print $this->getLanguage() ?>">
366369 <id><?php print $this->getFeedId() ?></id>
@@ -368,7 +371,7 @@
369372 <link rel="alternate" type="text/html" href="<?php print $this->getUrl() ?>"/>
370373 <updated><?php print $this->formatTime( wfTimestampNow() ) ?>Z</updated>
371374 <subtitle><?php print $this->getDescription() ?></subtitle>
372 - <generator>MediaWiki <?php print MW_VERSION ?></generator>
 375+ <generator>MediaWiki <?php print $wgVersion ?></generator>
373376
374377 <?php
375378 }
Index: trunk/phase3/includes/Export.php
@@ -406,7 +406,8 @@
407407 }
408408
409409 function generator() {
410 - return Xml::element( 'generator', array(), "MediaWiki " . MW_VERSION );
 410+ global $wgVersion;
 411+ return Xml::element( 'generator', array(), "MediaWiki $wgVersion" );
411412 }
412413
413414 function homelink() {
Index: trunk/phase3/includes/OutputPage.php
@@ -2672,7 +2672,7 @@
26732673 */
26742674 public function getHeadLinks( Skin $sk, $addContentType = false ) {
26752675 global $wgUniversalEditButton, $wgFavicon, $wgAppleTouchIcon, $wgEnableAPI,
2676 - $wgSitename, $wgHtml5, $wgMimeType,
 2676+ $wgSitename, $wgVersion, $wgHtml5, $wgMimeType,
26772677 $wgFeed, $wgOverrideSiteFeed, $wgAdvertisedFeedTypes,
26782678 $wgEnableDublinCoreRdf, $wgEnableCreativeCommonsRdf,
26792679 $wgDisableLangConversion, $wgCanonicalLanguageLinks, $wgContLang,
@@ -2699,7 +2699,7 @@
27002700
27012701 $tags[] = Html::element( 'meta', array(
27022702 'name' => 'generator',
2703 - 'content' => "MediaWiki " . MW_VERSION,
 2703+ 'content' => "MediaWiki $wgVersion",
27042704 ) );
27052705
27062706 $p = "{$this->mIndexPolicy},{$this->mFollowPolicy}";
Index: trunk/phase3/includes/installer/DatabaseUpdater.php
@@ -191,6 +191,7 @@
192192 * @param $what Array: what updates to perform
193193 */
194194 public function doUpdates( $what = array( 'core', 'extensions', 'purge' ) ) {
 195+ global $wgVersion;
195196
196197 $what = array_flip( $what );
197198 if ( isset( $what['core'] ) ) {
@@ -201,7 +202,7 @@
202203 $this->runUpdates( $this->getExtensionUpdates(), true );
203204 }
204205
205 - $this->setAppliedUpdates( MW_VERSION, $this->updates );
 206+ $this->setAppliedUpdates( $wgVersion, $this->updates );
206207
207208 if( isset( $what['purge'] ) ) {
208209 $this->purgeCache();
Index: trunk/phase3/includes/installer/Installer.php
@@ -24,8 +24,7 @@
2525 abstract class Installer {
2626
2727 // This is the absolute minimum PHP version we can support
28 - // @deprecated since 1.18
29 - const MINIMUM_PHP_VERSION = MW_MIN_PHP_VERSION;
 28+ const MINIMUM_PHP_VERSION = '5.2.3';
3029
3130 /**
3231 * @var array
@@ -379,11 +378,11 @@
380379 */
381380 public function doEnvironmentChecks() {
382381 $phpVersion = phpversion();
383 - if( version_compare( $phpVersion, MW_MIN_PHP_VERSION, '>=' ) ) {
 382+ if( version_compare( $phpVersion, self::MINIMUM_PHP_VERSION, '>=' ) ) {
384383 $this->showMessage( 'config-env-php', $phpVersion );
385384 $good = true;
386385 } else {
387 - $this->showMessage( 'config-env-php-toolow', $phpVersion, MW_MIN_PHP_VERSION );
 386+ $this->showMessage( 'config-env-php-toolow', $phpVersion, self::MINIMUM_PHP_VERSION );
388387 $good = false;
389388 }
390389
Index: trunk/phase3/includes/installer/WebInstallerOutput.php
@@ -270,7 +270,8 @@
271271 }
272272
273273 public function outputTitle() {
274 - echo htmlspecialchars( wfMsg( 'config-title', MW_VERSION ) );
 274+ global $wgVersion;
 275+ echo htmlspecialchars( wfMsg( 'config-title', $wgVersion ) );
275276 }
276277
277278 public function getJQuery() {
Index: trunk/phase3/includes/installer/MysqlInstaller.php
@@ -31,6 +31,8 @@
3232
3333 public $supportedEngines = array( 'InnoDB', 'MyISAM' );
3434
 35+ public $minimumVersion = '4.0.14';
 36+
3537 public $webUserPrivs = array(
3638 'DELETE',
3739 'INSERT',
@@ -102,8 +104,8 @@
103105
104106 // Check version
105107 $version = $conn->getServerVersion();
106 - if ( version_compare( $version, MW_MIN_MYSQL_VERSION ) < 0 ) {
107 - return Status::newFatal( 'config-mysql-old', MW_MIN_MYSQL_VERSION, $version );
 108+ if ( version_compare( $version, $this->minimumVersion ) < 0 ) {
 109+ return Status::newFatal( 'config-mysql-old', $this->minimumVersion, $version );
108110 }
109111
110112 return $status;
Index: trunk/phase3/includes/installer/OracleInstaller.php
@@ -26,6 +26,8 @@
2727 '_OracleDefTS' => 'USERS',
2828 '_OracleTempTS' => 'TEMP'
2929 );
 30+
 31+ public $minimumVersion = '9.0.1'; // 9iR1
3032
3133 protected $connError = null;
3234
@@ -118,8 +120,8 @@
119121
120122 // Check version
121123 $version = $conn->getServerVersion();
122 - if ( version_compare( $version, MW_MIN_ORACLE_VERSION ) < 0 ) {
123 - return Status::newFatal( 'config-oracle-old', MW_MIN_ORACLE_VERSION, $version );
 124+ if ( version_compare( $version, $this->minimumVersion ) < 0 ) {
 125+ return Status::newFatal( 'config-oracle-old', $this->minimumVersion, $version );
124126 }
125127
126128 return $status;
Index: trunk/phase3/includes/resourceloader/ResourceLoaderStartUpModule.php
@@ -35,7 +35,7 @@
3636 protected function getConfig( $context ) {
3737 global $wgLoadScript, $wgScript, $wgStylePath, $wgScriptExtension,
3838 $wgArticlePath, $wgScriptPath, $wgServer, $wgContLang,
39 - $wgVariantArticlePath, $wgActionPaths, $wgUseAjax,
 39+ $wgVariantArticlePath, $wgActionPaths, $wgUseAjax, $wgVersion,
4040 $wgEnableAPI, $wgEnableWriteAPI, $wgDBname, $wgEnableMWSuggest,
4141 $wgSitename, $wgFileExtensions, $wgExtensionAssetsPath, $wgProto,
4242 $wgCookiePrefix, $wgResourceLoaderMaxQueryLength, $wgLegacyJavaScriptGlobals;
@@ -71,7 +71,7 @@
7272 'wgServer' => $wgServer,
7373 'wgUserLanguage' => $context->getLanguage(),
7474 'wgContentLanguage' => $wgContLang->getCode(),
75 - 'wgVersion' => MW_VERSION,
 75+ 'wgVersion' => $wgVersion,
7676 'wgEnableAPI' => $wgEnableAPI,
7777 'wgEnableWriteAPI' => $wgEnableWriteAPI,
7878 'wgDefaultDateFormat' => $wgContLang->getDefaultDateFormat(),
Index: trunk/phase3/includes/DefaultSettings.php
@@ -33,11 +33,8 @@
3434 $wgConf = new SiteConfiguration;
3535 /** @endcond */
3636
37 -/**
38 - * MediaWiki version number
39 - * @deprecated use the constant MW_VERSION instead
40 - */
41 -$wgVersion = MW_VERSION;
 37+/** MediaWiki version number */
 38+$wgVersion = '1.19alpha';
4239
4340 /** Name of the site. It must be changed in LocalSettings.php */
4441 $wgSitename = 'MediaWiki';
@@ -4345,16 +4342,6 @@
43464343 /** Provide syndication feeds (RSS, Atom) for, e.g., Recentchanges, Newpages */
43474344 $wgFeed = true;
43484345
4349 -/**
4350 - * Available feeds objects
4351 - * Should probably only be defined when a page is syndicated ie when
4352 - * $wgOut->isSyndicated() is true
4353 - */
4354 -$wgFeedClasses = array(
4355 - 'rss' => 'RSSFeed',
4356 - 'atom' => 'AtomFeed',
4357 -);
4358 -
43594346 /** Set maximum number of results to return in syndication feeds (RSS, Atom) for
43604347 * eg Recentchanges, Newpages. */
43614348 $wgFeedLimit = 50;
Index: trunk/phase3/includes/HttpFunctions.php
@@ -112,7 +112,8 @@
113113 * @return String
114114 */
115115 public static function userAgent() {
116 - return "MediaWiki/" . MW_VERSION;
 116+ global $wgVersion;
 117+ return "MediaWiki/$wgVersion";
117118 }
118119
119120 /**
Index: trunk/phase3/includes/specials/SpecialVersion.php
@@ -159,16 +159,16 @@
160160 * @return mixed
161161 */
162162 public static function getVersion( $flags = '' ) {
163 - global $IP;
 163+ global $wgVersion, $IP;
164164 wfProfileIn( __METHOD__ );
165165
166166 $info = self::getSvnInfo( $IP );
167167 if ( !$info ) {
168 - $version = MW_VERSION;
 168+ $version = $wgVersion;
169169 } elseif( $flags === 'nodb' ) {
170 - $version = MW_VERSION . " (r{$info['checkout-rev']})";
 170+ $version = "$wgVersion (r{$info['checkout-rev']})";
171171 } else {
172 - $version = MW_VERSION . ' ' .
 172+ $version = $wgVersion . ' ' .
173173 wfMsg(
174174 'version-svn-revision',
175175 isset( $info['directory-rev'] ) ? $info['directory-rev'] : '',
@@ -187,13 +187,11 @@
188188 * @return mixed
189189 */
190190 public static function getVersionLinked() {
191 - global $IP;
 191+ global $wgVersion, $IP;
192192 wfProfileIn( __METHOD__ );
193193
194194 $info = self::getSvnInfo( $IP );
195195
196 - $version = MW_VERSION;
197 -
198196 if ( isset( $info['checkout-rev'] ) ) {
199197 $linkText = wfMsg(
200198 'version-svn-revision',
@@ -202,10 +200,12 @@
203201 );
204202
205203 if ( isset( $info['viewvc-url'] ) ) {
206 - $version .= " [{$info['viewvc-url']} $linkText]";
 204+ $version = "$wgVersion [{$info['viewvc-url']} $linkText]";
207205 } else {
208 - $version .= " $linkText";
 206+ $version = "$wgVersion $linkText";
209207 }
 208+ } else {
 209+ $version = $wgVersion;
210210 }
211211
212212 wfProfileOut( __METHOD__ );
@@ -681,10 +681,9 @@
682682
683683 function showEasterEgg() {
684684 $rx = $rp = $xe = '';
685 - $version = MW_VERSION;
686685 $alpha = array("", "kbQW", "\$\n()");
687686 $beta = implode( "', '", $alpha);
688 - $juliet = 'echo $delta + strrev($foxtrot) - $alfa + $version . base64_decode($bravo) * $charlie';
 687+ $juliet = 'echo $delta + strrev($foxtrot) - $alfa + $wgVersion . base64_decode($bravo) * $charlie';
689688 for ( $i = 1; $i <= 4; $i++ ) {
690689 $rx .= '([^j]*)J';
691690 $rp .= "+(\\$i)";
Index: trunk/phase3/index.php
@@ -36,18 +36,14 @@
3737 * @file
3838 */
3939
40 -// Load global constants, including MW_VERSION and MW_MIN_PHP_VERSION
41 -require_once( dirname( __FILE__ ) . '/includes/Defines.php' );
42 -
4340 // Bail on old versions of PHP. Pretty much every other file in the codebase
4441 // has structures (try/catch, foo()->bar(), etc etc) which throw parse errors in PHP 4.
4542 // Setup.php and ObjectCache.php have structures invalid in PHP 5.0 and 5.1, respectively.
46 -if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), MW_MIN_PHP_VERSION ) < 0 ) {
 43+if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.2.3' ) < 0 ) {
4744 $phpversion = htmlspecialchars( phpversion() );
48 - $reqVersion = htmlspecialchars( MW_MIN_PHP_VERSION );
4945 $errorMsg = <<<ENDL
5046 <p>
51 - MediaWiki requires PHP $reqVersion or higher. You are running PHP $phpversion.
 47+ MediaWiki requires PHP 5.2.3 or higher. You are running PHP $phpversion.
5248 </p>
5349 <p>
5450 Please consider <a href="http://www.php.net/downloads.php">upgrading your copy of PHP</a>.
@@ -164,8 +160,11 @@
165161 * @param $errorMsg String fully-escaped HTML
166162 */
167163 function wfDie( $errorMsg ){
168 - global $wgLogo;
169 - $version = htmlspecialchars( MW_VERSION );
 164+ // Use the version set in DefaultSettings if possible, but don't rely on it
 165+ global $wgVersion, $wgLogo;
 166+ $version = isset( $wgVersion ) && $wgVersion
 167+ ? htmlspecialchars( $wgVersion )
 168+ : '';
170169 $logo = isset( $wgLogo ) && $wgLogo
171170 ? $wgLogo
172171 : 'http://upload.wikimedia.org/wikipedia/commons/1/1c/MediaWiki_logo.png';
Index: trunk/phase3/api.php
@@ -37,9 +37,6 @@
3838 // So extensions (and other code) can check whether they're running in API mode
3939 define( 'MW_API', true );
4040
41 -// Include global constants, including MW_VERSION and MW_MIN_PHP_VERSION
42 -require_once( dirname( __FILE__ ) . '/includes/Defines.php' );
43 -
4441 // We want a plain message on catastrophic errors that machines can identify
4542 function wfDie( $msg = '' ) {
4643 header( $_SERVER['SERVER_PROTOCOL'] . ' 500 MediaWiki configuration Error', true, 500 );
@@ -48,10 +45,9 @@
4946 }
5047
5148 // Die on unsupported PHP versions
52 -if( !function_exists( 'version_compare' ) || version_compare( phpversion(), MW_MIN_PHP_VERSION ) < 0 ){
53 - $version = htmlspecialchars( MW_VERSION );
54 - $phpversion = htmlspecialchars( MW_MIN_PHP_VERSION );
55 - wfDie( "MediaWiki $version requires at least PHP version $phpversion." );
 49+if( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.2.3' ) < 0 ){
 50+ $version = htmlspecialchars( $wgVersion );
 51+ wfDie( "MediaWiki $version requires at least PHP version 5.2.3." );
5652 }
5753
5854 // Initialise common code.
Index: trunk/phase3/load.php
@@ -30,14 +30,10 @@
3131 die( 1 );
3232 }
3333
34 -// Load global constants, including MW_VERSION and MW_MIN_PHP_VERSION
35 -require_once( dirname( __FILE__ ) . '/includes/Defines.php' );
36 -
3734 // Die on unsupported PHP versions
38 -if( !function_exists( 'version_compare' ) || version_compare( phpversion(), MW_MIN_PHP_VERSION ) < 0 ){
39 - $version = htmlspecialchars( MW_VERSION );
40 - $phpversion = htmlspecialchars( MW_MIN_PHP_VERSION );
41 - wfDie( "MediaWiki $version requires at least PHP version $phpversion." );
 35+if( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.2.3' ) < 0 ){
 36+ $version = htmlspecialchars( $wgVersion );
 37+ wfDie( "MediaWiki $version requires at least PHP version 5.2.3." );
4238 }
4339
4440 require ( dirname( __FILE__ ) . '/includes/WebStart.php' );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r87635* Implement MW_VERSION constant in Defines.php and use it in preference to $w...happy-melon14:53, 7 May 2011
r87637Centralise the minimum-required-php-version in a MW_MIN_PHP_VERSION constant ...happy-melon15:16, 7 May 2011
r87639Move minimum database versions to Defines.phphappy-melon15:25, 7 May 2011
r87643Follow-up r87637: the terrors of copy-and-paste.happy-melon15:37, 7 May 2011

Comments

#Comment by Happy-melon (talk | contribs)   13:45, 15 May 2011

I don't believe r87635 or r87639 should have affected HipHop support, am I mistaken? While I suspected that moving the includes might cause issues, I can find no documentation about exactly why doing so is problematic, or what the solution is. I appreciate that this is a bleeding-edge area of work, but it would be helpful if you could explain exactly how/why this "breaks HipHop support". Otherwise similar issues will certainly recur in the future.

#Comment by Tim Starling (talk | contribs)   01:36, 30 May 2011

Probably not, it was r87637 that was the problem. But I thought they were all part of the same set of interdependent changes, and I was trying to revert back to the most recent working revision. Plus there were already two requests on CR to revert r87635, so I didn't think it would be controversial.

Status & tagging log