Index: trunk/phase3/maintenance/update.php |
— | — | @@ -25,12 +25,8 @@ |
26 | 26 | * @ingroup Maintenance |
27 | 27 | */ |
28 | 28 | |
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" . |
35 | 31 | "Check if you have a newer php executable with a different name, such as php5.\n"; |
36 | 32 | die( 1 ); |
37 | 33 | } |
Index: trunk/phase3/maintenance/install.php |
— | — | @@ -20,13 +20,9 @@ |
21 | 21 | * @see wfWaitForSlaves() |
22 | 22 | */ |
23 | 23 | |
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"; |
31 | 27 | die( 1 ); |
32 | 28 | } |
33 | 29 | |
Index: trunk/phase3/maintenance/Maintenance.php |
— | — | @@ -20,9 +20,6 @@ |
21 | 21 | * @defgroup Maintenance Maintenance |
22 | 22 | */ |
23 | 23 | |
24 | | -// Include global constants, including MW_VERSION and MW_MIN_PHP_VERSION |
25 | | -require_once( dirname( dirname( __FILE__ ) ) . '/includes/Defines.php' ); |
26 | | - |
27 | 24 | // Define this so scripts can easily find doMaintenance.php |
28 | 25 | define( 'RUN_MAINTENANCE_IF_MAIN', dirname( __FILE__ ) . '/doMaintenance.php' ); |
29 | 26 | define( 'DO_MAINTENANCE', RUN_MAINTENANCE_IF_MAIN ); // original name, harmless |
— | — | @@ -30,10 +27,10 @@ |
31 | 28 | $maintClass = false; |
32 | 29 | |
33 | 30 | // 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 " . |
36 | 33 | 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" . |
38 | 35 | "installed in a different path from PHP " . PHP_VERSION . ". Check with your system\n" . |
39 | 36 | "administrator.\n" ); |
40 | 37 | } |
Index: trunk/phase3/tests/parserTests.php |
— | — | @@ -30,9 +30,8 @@ |
31 | 31 | require_once( dirname( __FILE__ ) . '/../maintenance/commandLine.inc' ); |
32 | 32 | |
33 | 33 | if ( isset( $options['help'] ) ) { |
34 | | - $version = MW_VERSION; |
35 | 34 | echo <<<ENDS |
36 | | -MediaWiki $version parser test suite |
| 35 | +MediaWiki $wgVersion parser test suite |
37 | 36 | Usage: php parserTests.php [options...] |
38 | 37 | |
39 | 38 | Options: |
Index: trunk/phase3/includes/Defines.php |
— | — | @@ -1,8 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /** |
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. |
7 | 5 | * |
8 | 6 | * Note: these constants must all be resolvable at compile time by HipHop, |
9 | 7 | * since this file will not be executed during request startup for a compiled |
— | — | @@ -11,23 +9,11 @@ |
12 | 10 | * @file |
13 | 11 | */ |
14 | 12 | |
15 | | -/**@{ |
| 13 | +/** |
16 | 14 | * Version constants for the benefit of extensions |
17 | 15 | */ |
18 | | -define( 'MW_VERSION', '1.19alpha' ); |
19 | 16 | define( 'MW_SPECIALPAGE_VERSION', 2 ); |
20 | 17 | |
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 | | - |
32 | 18 | /**@{ |
33 | 19 | * Database related constants |
34 | 20 | */ |
— | — | @@ -99,6 +85,16 @@ |
100 | 86 | define( 'NS_IMAGE_TALK', NS_FILE_TALK ); |
101 | 87 | /**@}*/ |
102 | 88 | |
| 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 | + |
103 | 99 | /**@{ |
104 | 100 | * Cache type |
105 | 101 | */ |
Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -2500,8 +2500,10 @@ |
2501 | 2501 | * a float |
2502 | 2502 | */ |
2503 | 2503 | 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" ); |
2506 | 2508 | } |
2507 | 2509 | } |
2508 | 2510 | |
Index: trunk/phase3/includes/Setup.php |
— | — | @@ -23,7 +23,6 @@ |
24 | 24 | wfProfileIn( $fname ); |
25 | 25 | |
26 | 26 | // 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? |
28 | 27 | if ( !isset( $wgVersion ) ) { |
29 | 28 | echo "Error, Setup.php must be included from the file scope, after DefaultSettings.php\n"; |
30 | 29 | die( 1 ); |
Index: trunk/phase3/includes/Feed.php |
— | — | @@ -301,6 +301,7 @@ |
302 | 302 | * Ouput an RSS 2.0 header |
303 | 303 | */ |
304 | 304 | function outHeader() { |
| 305 | + global $wgVersion; |
305 | 306 | |
306 | 307 | $this->outXmlHeader(); |
307 | 308 | ?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"> |
— | — | @@ -309,7 +310,7 @@ |
310 | 311 | <link><?php print $this->getUrl() ?></link> |
311 | 312 | <description><?php print $this->getDescription() ?></description> |
312 | 313 | <language><?php print $this->getLanguage() ?></language> |
313 | | - <generator>MediaWiki <?php print MW_VERSION ?></generator> |
| 314 | + <generator>MediaWiki <?php print $wgVersion ?></generator> |
314 | 315 | <lastBuildDate><?php print $this->formatTime( wfTimestampNow() ) ?></lastBuildDate> |
315 | 316 | <?php |
316 | 317 | } |
— | — | @@ -360,6 +361,8 @@ |
361 | 362 | * Outputs a basic header for Atom 1.0 feeds. |
362 | 363 | */ |
363 | 364 | function outHeader() { |
| 365 | + global $wgVersion; |
| 366 | + |
364 | 367 | $this->outXmlHeader(); |
365 | 368 | ?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="<?php print $this->getLanguage() ?>"> |
366 | 369 | <id><?php print $this->getFeedId() ?></id> |
— | — | @@ -368,7 +371,7 @@ |
369 | 372 | <link rel="alternate" type="text/html" href="<?php print $this->getUrl() ?>"/> |
370 | 373 | <updated><?php print $this->formatTime( wfTimestampNow() ) ?>Z</updated> |
371 | 374 | <subtitle><?php print $this->getDescription() ?></subtitle> |
372 | | - <generator>MediaWiki <?php print MW_VERSION ?></generator> |
| 375 | + <generator>MediaWiki <?php print $wgVersion ?></generator> |
373 | 376 | |
374 | 377 | <?php |
375 | 378 | } |
Index: trunk/phase3/includes/Export.php |
— | — | @@ -406,7 +406,8 @@ |
407 | 407 | } |
408 | 408 | |
409 | 409 | function generator() { |
410 | | - return Xml::element( 'generator', array(), "MediaWiki " . MW_VERSION ); |
| 410 | + global $wgVersion; |
| 411 | + return Xml::element( 'generator', array(), "MediaWiki $wgVersion" ); |
411 | 412 | } |
412 | 413 | |
413 | 414 | function homelink() { |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -2672,7 +2672,7 @@ |
2673 | 2673 | */ |
2674 | 2674 | public function getHeadLinks( Skin $sk, $addContentType = false ) { |
2675 | 2675 | global $wgUniversalEditButton, $wgFavicon, $wgAppleTouchIcon, $wgEnableAPI, |
2676 | | - $wgSitename, $wgHtml5, $wgMimeType, |
| 2676 | + $wgSitename, $wgVersion, $wgHtml5, $wgMimeType, |
2677 | 2677 | $wgFeed, $wgOverrideSiteFeed, $wgAdvertisedFeedTypes, |
2678 | 2678 | $wgEnableDublinCoreRdf, $wgEnableCreativeCommonsRdf, |
2679 | 2679 | $wgDisableLangConversion, $wgCanonicalLanguageLinks, $wgContLang, |
— | — | @@ -2699,7 +2699,7 @@ |
2700 | 2700 | |
2701 | 2701 | $tags[] = Html::element( 'meta', array( |
2702 | 2702 | 'name' => 'generator', |
2703 | | - 'content' => "MediaWiki " . MW_VERSION, |
| 2703 | + 'content' => "MediaWiki $wgVersion", |
2704 | 2704 | ) ); |
2705 | 2705 | |
2706 | 2706 | $p = "{$this->mIndexPolicy},{$this->mFollowPolicy}"; |
Index: trunk/phase3/includes/installer/DatabaseUpdater.php |
— | — | @@ -191,6 +191,7 @@ |
192 | 192 | * @param $what Array: what updates to perform |
193 | 193 | */ |
194 | 194 | public function doUpdates( $what = array( 'core', 'extensions', 'purge' ) ) { |
| 195 | + global $wgVersion; |
195 | 196 | |
196 | 197 | $what = array_flip( $what ); |
197 | 198 | if ( isset( $what['core'] ) ) { |
— | — | @@ -201,7 +202,7 @@ |
202 | 203 | $this->runUpdates( $this->getExtensionUpdates(), true ); |
203 | 204 | } |
204 | 205 | |
205 | | - $this->setAppliedUpdates( MW_VERSION, $this->updates ); |
| 206 | + $this->setAppliedUpdates( $wgVersion, $this->updates ); |
206 | 207 | |
207 | 208 | if( isset( $what['purge'] ) ) { |
208 | 209 | $this->purgeCache(); |
Index: trunk/phase3/includes/installer/Installer.php |
— | — | @@ -24,8 +24,7 @@ |
25 | 25 | abstract class Installer { |
26 | 26 | |
27 | 27 | // 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'; |
30 | 29 | |
31 | 30 | /** |
32 | 31 | * @var array |
— | — | @@ -379,11 +378,11 @@ |
380 | 379 | */ |
381 | 380 | public function doEnvironmentChecks() { |
382 | 381 | $phpVersion = phpversion(); |
383 | | - if( version_compare( $phpVersion, MW_MIN_PHP_VERSION, '>=' ) ) { |
| 382 | + if( version_compare( $phpVersion, self::MINIMUM_PHP_VERSION, '>=' ) ) { |
384 | 383 | $this->showMessage( 'config-env-php', $phpVersion ); |
385 | 384 | $good = true; |
386 | 385 | } 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 ); |
388 | 387 | $good = false; |
389 | 388 | } |
390 | 389 | |
Index: trunk/phase3/includes/installer/WebInstallerOutput.php |
— | — | @@ -270,7 +270,8 @@ |
271 | 271 | } |
272 | 272 | |
273 | 273 | public function outputTitle() { |
274 | | - echo htmlspecialchars( wfMsg( 'config-title', MW_VERSION ) ); |
| 274 | + global $wgVersion; |
| 275 | + echo htmlspecialchars( wfMsg( 'config-title', $wgVersion ) ); |
275 | 276 | } |
276 | 277 | |
277 | 278 | public function getJQuery() { |
Index: trunk/phase3/includes/installer/MysqlInstaller.php |
— | — | @@ -31,6 +31,8 @@ |
32 | 32 | |
33 | 33 | public $supportedEngines = array( 'InnoDB', 'MyISAM' ); |
34 | 34 | |
| 35 | + public $minimumVersion = '4.0.14'; |
| 36 | + |
35 | 37 | public $webUserPrivs = array( |
36 | 38 | 'DELETE', |
37 | 39 | 'INSERT', |
— | — | @@ -102,8 +104,8 @@ |
103 | 105 | |
104 | 106 | // Check version |
105 | 107 | $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 ); |
108 | 110 | } |
109 | 111 | |
110 | 112 | return $status; |
Index: trunk/phase3/includes/installer/OracleInstaller.php |
— | — | @@ -26,6 +26,8 @@ |
27 | 27 | '_OracleDefTS' => 'USERS', |
28 | 28 | '_OracleTempTS' => 'TEMP' |
29 | 29 | ); |
| 30 | + |
| 31 | + public $minimumVersion = '9.0.1'; // 9iR1 |
30 | 32 | |
31 | 33 | protected $connError = null; |
32 | 34 | |
— | — | @@ -118,8 +120,8 @@ |
119 | 121 | |
120 | 122 | // Check version |
121 | 123 | $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 ); |
124 | 126 | } |
125 | 127 | |
126 | 128 | return $status; |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderStartUpModule.php |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | protected function getConfig( $context ) { |
37 | 37 | global $wgLoadScript, $wgScript, $wgStylePath, $wgScriptExtension, |
38 | 38 | $wgArticlePath, $wgScriptPath, $wgServer, $wgContLang, |
39 | | - $wgVariantArticlePath, $wgActionPaths, $wgUseAjax, |
| 39 | + $wgVariantArticlePath, $wgActionPaths, $wgUseAjax, $wgVersion, |
40 | 40 | $wgEnableAPI, $wgEnableWriteAPI, $wgDBname, $wgEnableMWSuggest, |
41 | 41 | $wgSitename, $wgFileExtensions, $wgExtensionAssetsPath, $wgProto, |
42 | 42 | $wgCookiePrefix, $wgResourceLoaderMaxQueryLength, $wgLegacyJavaScriptGlobals; |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | 'wgServer' => $wgServer, |
73 | 73 | 'wgUserLanguage' => $context->getLanguage(), |
74 | 74 | 'wgContentLanguage' => $wgContLang->getCode(), |
75 | | - 'wgVersion' => MW_VERSION, |
| 75 | + 'wgVersion' => $wgVersion, |
76 | 76 | 'wgEnableAPI' => $wgEnableAPI, |
77 | 77 | 'wgEnableWriteAPI' => $wgEnableWriteAPI, |
78 | 78 | 'wgDefaultDateFormat' => $wgContLang->getDefaultDateFormat(), |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -33,11 +33,8 @@ |
34 | 34 | $wgConf = new SiteConfiguration; |
35 | 35 | /** @endcond */ |
36 | 36 | |
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'; |
42 | 39 | |
43 | 40 | /** Name of the site. It must be changed in LocalSettings.php */ |
44 | 41 | $wgSitename = 'MediaWiki'; |
— | — | @@ -4345,16 +4342,6 @@ |
4346 | 4343 | /** Provide syndication feeds (RSS, Atom) for, e.g., Recentchanges, Newpages */ |
4347 | 4344 | $wgFeed = true; |
4348 | 4345 | |
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 | | - |
4359 | 4346 | /** Set maximum number of results to return in syndication feeds (RSS, Atom) for |
4360 | 4347 | * eg Recentchanges, Newpages. */ |
4361 | 4348 | $wgFeedLimit = 50; |
Index: trunk/phase3/includes/HttpFunctions.php |
— | — | @@ -112,7 +112,8 @@ |
113 | 113 | * @return String |
114 | 114 | */ |
115 | 115 | public static function userAgent() { |
116 | | - return "MediaWiki/" . MW_VERSION; |
| 116 | + global $wgVersion; |
| 117 | + return "MediaWiki/$wgVersion"; |
117 | 118 | } |
118 | 119 | |
119 | 120 | /** |
Index: trunk/phase3/includes/specials/SpecialVersion.php |
— | — | @@ -159,16 +159,16 @@ |
160 | 160 | * @return mixed |
161 | 161 | */ |
162 | 162 | public static function getVersion( $flags = '' ) { |
163 | | - global $IP; |
| 163 | + global $wgVersion, $IP; |
164 | 164 | wfProfileIn( __METHOD__ ); |
165 | 165 | |
166 | 166 | $info = self::getSvnInfo( $IP ); |
167 | 167 | if ( !$info ) { |
168 | | - $version = MW_VERSION; |
| 168 | + $version = $wgVersion; |
169 | 169 | } elseif( $flags === 'nodb' ) { |
170 | | - $version = MW_VERSION . " (r{$info['checkout-rev']})"; |
| 170 | + $version = "$wgVersion (r{$info['checkout-rev']})"; |
171 | 171 | } else { |
172 | | - $version = MW_VERSION . ' ' . |
| 172 | + $version = $wgVersion . ' ' . |
173 | 173 | wfMsg( |
174 | 174 | 'version-svn-revision', |
175 | 175 | isset( $info['directory-rev'] ) ? $info['directory-rev'] : '', |
— | — | @@ -187,13 +187,11 @@ |
188 | 188 | * @return mixed |
189 | 189 | */ |
190 | 190 | public static function getVersionLinked() { |
191 | | - global $IP; |
| 191 | + global $wgVersion, $IP; |
192 | 192 | wfProfileIn( __METHOD__ ); |
193 | 193 | |
194 | 194 | $info = self::getSvnInfo( $IP ); |
195 | 195 | |
196 | | - $version = MW_VERSION; |
197 | | - |
198 | 196 | if ( isset( $info['checkout-rev'] ) ) { |
199 | 197 | $linkText = wfMsg( |
200 | 198 | 'version-svn-revision', |
— | — | @@ -202,10 +200,12 @@ |
203 | 201 | ); |
204 | 202 | |
205 | 203 | if ( isset( $info['viewvc-url'] ) ) { |
206 | | - $version .= " [{$info['viewvc-url']} $linkText]"; |
| 204 | + $version = "$wgVersion [{$info['viewvc-url']} $linkText]"; |
207 | 205 | } else { |
208 | | - $version .= " $linkText"; |
| 206 | + $version = "$wgVersion $linkText"; |
209 | 207 | } |
| 208 | + } else { |
| 209 | + $version = $wgVersion; |
210 | 210 | } |
211 | 211 | |
212 | 212 | wfProfileOut( __METHOD__ ); |
— | — | @@ -681,10 +681,9 @@ |
682 | 682 | |
683 | 683 | function showEasterEgg() { |
684 | 684 | $rx = $rp = $xe = ''; |
685 | | - $version = MW_VERSION; |
686 | 685 | $alpha = array("", "kbQW", "\$\n()"); |
687 | 686 | $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'; |
689 | 688 | for ( $i = 1; $i <= 4; $i++ ) { |
690 | 689 | $rx .= '([^j]*)J'; |
691 | 690 | $rp .= "+(\\$i)"; |
Index: trunk/phase3/index.php |
— | — | @@ -36,18 +36,14 @@ |
37 | 37 | * @file |
38 | 38 | */ |
39 | 39 | |
40 | | -// Load global constants, including MW_VERSION and MW_MIN_PHP_VERSION |
41 | | -require_once( dirname( __FILE__ ) . '/includes/Defines.php' ); |
42 | | - |
43 | 40 | // Bail on old versions of PHP. Pretty much every other file in the codebase |
44 | 41 | // has structures (try/catch, foo()->bar(), etc etc) which throw parse errors in PHP 4. |
45 | 42 | // 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 ) { |
47 | 44 | $phpversion = htmlspecialchars( phpversion() ); |
48 | | - $reqVersion = htmlspecialchars( MW_MIN_PHP_VERSION ); |
49 | 45 | $errorMsg = <<<ENDL |
50 | 46 | <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. |
52 | 48 | </p> |
53 | 49 | <p> |
54 | 50 | Please consider <a href="http://www.php.net/downloads.php">upgrading your copy of PHP</a>. |
— | — | @@ -164,8 +160,11 @@ |
165 | 161 | * @param $errorMsg String fully-escaped HTML |
166 | 162 | */ |
167 | 163 | 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 | + : ''; |
170 | 169 | $logo = isset( $wgLogo ) && $wgLogo |
171 | 170 | ? $wgLogo |
172 | 171 | : 'http://upload.wikimedia.org/wikipedia/commons/1/1c/MediaWiki_logo.png'; |
Index: trunk/phase3/api.php |
— | — | @@ -37,9 +37,6 @@ |
38 | 38 | // So extensions (and other code) can check whether they're running in API mode |
39 | 39 | define( 'MW_API', true ); |
40 | 40 | |
41 | | -// Include global constants, including MW_VERSION and MW_MIN_PHP_VERSION |
42 | | -require_once( dirname( __FILE__ ) . '/includes/Defines.php' ); |
43 | | - |
44 | 41 | // We want a plain message on catastrophic errors that machines can identify |
45 | 42 | function wfDie( $msg = '' ) { |
46 | 43 | header( $_SERVER['SERVER_PROTOCOL'] . ' 500 MediaWiki configuration Error', true, 500 ); |
— | — | @@ -48,10 +45,9 @@ |
49 | 46 | } |
50 | 47 | |
51 | 48 | // 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." ); |
56 | 52 | } |
57 | 53 | |
58 | 54 | // Initialise common code. |
Index: trunk/phase3/load.php |
— | — | @@ -30,14 +30,10 @@ |
31 | 31 | die( 1 ); |
32 | 32 | } |
33 | 33 | |
34 | | -// Load global constants, including MW_VERSION and MW_MIN_PHP_VERSION |
35 | | -require_once( dirname( __FILE__ ) . '/includes/Defines.php' ); |
36 | | - |
37 | 34 | // 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." ); |
42 | 38 | } |
43 | 39 | |
44 | 40 | require ( dirname( __FILE__ ) . '/includes/WebStart.php' ); |