Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -33,8 +33,11 @@ |
34 | 34 | $wgConf = new SiteConfiguration; |
35 | 35 | /** @endcond */ |
36 | 36 | |
37 | | -/** MediaWiki version number */ |
38 | | -$wgVersion = '1.19alpha'; |
| 37 | +/** |
| 38 | + * MediaWiki version number |
| 39 | + * @deprecated use the constant MW_VERSION instead |
| 40 | + */ |
| 41 | +$wgVersion = MW_VERSION; |
39 | 42 | |
40 | 43 | /** Name of the site. It must be changed in LocalSettings.php */ |
41 | 44 | $wgSitename = 'MediaWiki'; |
— | — | @@ -4311,6 +4314,16 @@ |
4312 | 4315 | /** Provide syndication feeds (RSS, Atom) for, e.g., Recentchanges, Newpages */ |
4313 | 4316 | $wgFeed = true; |
4314 | 4317 | |
| 4318 | +/** |
| 4319 | + * Available feeds objects |
| 4320 | + * Should probably only be defined when a page is syndicated ie when |
| 4321 | + * $wgOut->isSyndicated() is true |
| 4322 | + */ |
| 4323 | +$wgFeedClasses = array( |
| 4324 | + 'rss' => 'RSSFeed', |
| 4325 | + 'atom' => 'AtomFeed', |
| 4326 | +); |
| 4327 | + |
4315 | 4328 | /** Set maximum number of results to return in syndication feeds (RSS, Atom) for |
4316 | 4329 | * eg Recentchanges, Newpages. */ |
4317 | 4330 | $wgFeedLimit = 50; |
Index: trunk/phase3/includes/HttpFunctions.php |
— | — | @@ -112,8 +112,7 @@ |
113 | 113 | * @return String |
114 | 114 | */ |
115 | 115 | public static function userAgent() { |
116 | | - global $wgVersion; |
117 | | - return "MediaWiki/$wgVersion"; |
| 116 | + return "MediaWiki/" . MW_VERSION; |
118 | 117 | } |
119 | 118 | |
120 | 119 | /** |
Index: trunk/phase3/includes/specials/SpecialVersion.php |
— | — | @@ -158,16 +158,16 @@ |
159 | 159 | * @return mixed |
160 | 160 | */ |
161 | 161 | public static function getVersion( $flags = '' ) { |
162 | | - global $wgVersion, $IP; |
| 162 | + global $IP; |
163 | 163 | wfProfileIn( __METHOD__ ); |
164 | 164 | |
165 | 165 | $info = self::getSvnInfo( $IP ); |
166 | 166 | if ( !$info ) { |
167 | | - $version = $wgVersion; |
| 167 | + $version = MW_VERSION; |
168 | 168 | } elseif( $flags === 'nodb' ) { |
169 | | - $version = "$wgVersion (r{$info['checkout-rev']})"; |
| 169 | + $version = MW_VERSION . " (r{$info['checkout-rev']})"; |
170 | 170 | } else { |
171 | | - $version = $wgVersion . ' ' . |
| 171 | + $version = MW_VERSION . ' ' . |
172 | 172 | wfMsg( |
173 | 173 | 'version-svn-revision', |
174 | 174 | isset( $info['directory-rev'] ) ? $info['directory-rev'] : '', |
— | — | @@ -186,11 +186,13 @@ |
187 | 187 | * @return mixed |
188 | 188 | */ |
189 | 189 | public static function getVersionLinked() { |
190 | | - global $wgVersion, $IP; |
| 190 | + global $IP; |
191 | 191 | wfProfileIn( __METHOD__ ); |
192 | 192 | |
193 | 193 | $info = self::getSvnInfo( $IP ); |
194 | 194 | |
| 195 | + $version = MW_VERSION; |
| 196 | + |
195 | 197 | if ( isset( $info['checkout-rev'] ) ) { |
196 | 198 | $linkText = wfMsg( |
197 | 199 | 'version-svn-revision', |
— | — | @@ -199,12 +201,10 @@ |
200 | 202 | ); |
201 | 203 | |
202 | 204 | if ( isset( $info['viewvc-url'] ) ) { |
203 | | - $version = "$wgVersion [{$info['viewvc-url']} $linkText]"; |
| 205 | + $version .= " [{$info['viewvc-url']} $linkText]"; |
204 | 206 | } else { |
205 | | - $version = "$wgVersion $linkText"; |
| 207 | + $version .= " $linkText"; |
206 | 208 | } |
207 | | - } else { |
208 | | - $version = $wgVersion; |
209 | 209 | } |
210 | 210 | |
211 | 211 | wfProfileOut( __METHOD__ ); |
— | — | @@ -680,9 +680,10 @@ |
681 | 681 | |
682 | 682 | function showEasterEgg() { |
683 | 683 | $rx = $rp = $xe = ''; |
| 684 | + $version = MW_VERSION; |
684 | 685 | $alpha = array("", "kbQW", "\$\n()"); |
685 | 686 | $beta = implode( "', '", $alpha); |
686 | | - $juliet = 'echo $delta + strrev($foxtrot) - $alfa + $wgVersion . base64_decode($bravo) * $charlie'; |
| 687 | + $juliet = 'echo $delta + strrev($foxtrot) - $alfa + $version . base64_decode($bravo) * $charlie'; |
687 | 688 | for ( $i = 1; $i <= 4; $i++ ) { |
688 | 689 | $rx .= '([^j]*)J'; |
689 | 690 | $rp .= "+(\\$i)"; |
Index: trunk/phase3/includes/Defines.php |
— | — | @@ -9,9 +9,10 @@ |
10 | 10 | * @file |
11 | 11 | */ |
12 | 12 | |
13 | | -/** |
| 13 | +/**@{ |
14 | 14 | * Version constants for the benefit of extensions |
15 | 15 | */ |
| 16 | +define( 'MW_VERSION', '1.19alpha' ); |
16 | 17 | define( 'MW_SPECIALPAGE_VERSION', 2 ); |
17 | 18 | |
18 | 19 | /**@{ |
— | — | @@ -85,16 +86,6 @@ |
86 | 87 | define( 'NS_IMAGE_TALK', NS_FILE_TALK ); |
87 | 88 | /**@}*/ |
88 | 89 | |
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 | | - |
99 | 90 | /**@{ |
100 | 91 | * Cache type |
101 | 92 | */ |
Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -2500,10 +2500,8 @@ |
2501 | 2501 | * a float |
2502 | 2502 | */ |
2503 | 2503 | function wfUseMW( $req_ver ) { |
2504 | | - global $wgVersion; |
2505 | | - |
2506 | | - if ( version_compare( $wgVersion, (string)$req_ver, '<' ) ) { |
2507 | | - throw new MWException( "MediaWiki $req_ver required--this is only $wgVersion" ); |
| 2504 | + if ( version_compare( MW_VERSION, (string)$req_ver, '<' ) ) { |
| 2505 | + throw new MWException( "MediaWiki $req_ver required--this is only " . MW_VERSION ); |
2508 | 2506 | } |
2509 | 2507 | } |
2510 | 2508 | |
Index: trunk/phase3/includes/Setup.php |
— | — | @@ -23,6 +23,7 @@ |
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? |
27 | 28 | if ( !isset( $wgVersion ) ) { |
28 | 29 | echo "Error, Setup.php must be included from the file scope, after DefaultSettings.php\n"; |
29 | 30 | die( 1 ); |
Index: trunk/phase3/includes/Feed.php |
— | — | @@ -301,7 +301,6 @@ |
302 | 302 | * Ouput an RSS 2.0 header |
303 | 303 | */ |
304 | 304 | function outHeader() { |
305 | | - global $wgVersion; |
306 | 305 | |
307 | 306 | $this->outXmlHeader(); |
308 | 307 | ?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"> |
— | — | @@ -310,7 +309,7 @@ |
311 | 310 | <link><?php print $this->getUrl() ?></link> |
312 | 311 | <description><?php print $this->getDescription() ?></description> |
313 | 312 | <language><?php print $this->getLanguage() ?></language> |
314 | | - <generator>MediaWiki <?php print $wgVersion ?></generator> |
| 313 | + <generator>MediaWiki <?php print MW_VERSION ?></generator> |
315 | 314 | <lastBuildDate><?php print $this->formatTime( wfTimestampNow() ) ?></lastBuildDate> |
316 | 315 | <?php |
317 | 316 | } |
— | — | @@ -361,8 +360,6 @@ |
362 | 361 | * Outputs a basic header for Atom 1.0 feeds. |
363 | 362 | */ |
364 | 363 | function outHeader() { |
365 | | - global $wgVersion; |
366 | | - |
367 | 364 | $this->outXmlHeader(); |
368 | 365 | ?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="<?php print $this->getLanguage() ?>"> |
369 | 366 | <id><?php print $this->getFeedId() ?></id> |
— | — | @@ -371,7 +368,7 @@ |
372 | 369 | <link rel="alternate" type="text/html" href="<?php print $this->getUrl() ?>"/> |
373 | 370 | <updated><?php print $this->formatTime( wfTimestampNow() ) ?>Z</updated> |
374 | 371 | <subtitle><?php print $this->getDescription() ?></subtitle> |
375 | | - <generator>MediaWiki <?php print $wgVersion ?></generator> |
| 372 | + <generator>MediaWiki <?php print MW_VERSION ?></generator> |
376 | 373 | |
377 | 374 | <?php |
378 | 375 | } |
Index: trunk/phase3/includes/Export.php |
— | — | @@ -406,8 +406,7 @@ |
407 | 407 | } |
408 | 408 | |
409 | 409 | function generator() { |
410 | | - global $wgVersion; |
411 | | - return Xml::element( 'generator', array(), "MediaWiki $wgVersion" ); |
| 410 | + return Xml::element( 'generator', array(), "MediaWiki " . MW_VERSION ); |
412 | 411 | } |
413 | 412 | |
414 | 413 | function homelink() { |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -2683,7 +2683,7 @@ |
2684 | 2684 | */ |
2685 | 2685 | public function getHeadLinks( Skin $sk, $addContentType = false ) { |
2686 | 2686 | global $wgUniversalEditButton, $wgFavicon, $wgAppleTouchIcon, $wgEnableAPI, |
2687 | | - $wgSitename, $wgVersion, $wgHtml5, $wgMimeType, |
| 2687 | + $wgSitename, $wgHtml5, $wgMimeType, |
2688 | 2688 | $wgFeed, $wgOverrideSiteFeed, $wgAdvertisedFeedTypes, |
2689 | 2689 | $wgEnableDublinCoreRdf, $wgEnableCreativeCommonsRdf, |
2690 | 2690 | $wgDisableLangConversion, $wgCanonicalLanguageLinks, $wgContLang, |
— | — | @@ -2710,7 +2710,7 @@ |
2711 | 2711 | |
2712 | 2712 | $tags[] = Html::element( 'meta', array( |
2713 | 2713 | 'name' => 'generator', |
2714 | | - 'content' => "MediaWiki $wgVersion", |
| 2714 | + 'content' => "MediaWiki " . MW_VERSION, |
2715 | 2715 | ) ); |
2716 | 2716 | |
2717 | 2717 | $p = "{$this->mIndexPolicy},{$this->mFollowPolicy}"; |
Index: trunk/phase3/includes/installer/DatabaseUpdater.php |
— | — | @@ -191,7 +191,6 @@ |
192 | 192 | * @param $what Array: what updates to perform |
193 | 193 | */ |
194 | 194 | public function doUpdates( $what = array( 'core', 'extensions', 'purge' ) ) { |
195 | | - global $wgVersion; |
196 | 195 | |
197 | 196 | $what = array_flip( $what ); |
198 | 197 | if ( isset( $what['core'] ) ) { |
— | — | @@ -202,7 +201,7 @@ |
203 | 202 | $this->runUpdates( $this->getExtensionUpdates(), true ); |
204 | 203 | } |
205 | 204 | |
206 | | - $this->setAppliedUpdates( $wgVersion, $this->updates ); |
| 205 | + $this->setAppliedUpdates( MW_VERSION, $this->updates ); |
207 | 206 | |
208 | 207 | if( isset( $what['purge'] ) ) { |
209 | 208 | $this->purgeCache(); |
Index: trunk/phase3/includes/installer/WebInstallerOutput.php |
— | — | @@ -270,8 +270,7 @@ |
271 | 271 | } |
272 | 272 | |
273 | 273 | public function outputTitle() { |
274 | | - global $wgVersion; |
275 | | - echo htmlspecialchars( wfMsg( 'config-title', $wgVersion ) ); |
| 274 | + echo htmlspecialchars( wfMsg( 'config-title', MW_VERSION ) ); |
276 | 275 | } |
277 | 276 | |
278 | 277 | public function getJQuery() { |
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, $wgVersion, |
| 39 | + $wgVariantArticlePath, $wgActionPaths, $wgUseAjax, |
40 | 40 | $wgEnableAPI, $wgEnableWriteAPI, $wgDBname, $wgEnableMWSuggest, |
41 | 41 | $wgSitename, $wgFileExtensions, $wgExtensionAssetsPath, $wgProto, |
42 | 42 | $wgCookiePrefix, $wgResourceLoaderMaxQueryLength; |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | 'wgServer' => $wgServer, |
73 | 73 | 'wgUserLanguage' => $context->getLanguage(), |
74 | 74 | 'wgContentLanguage' => $wgContLang->getCode(), |
75 | | - 'wgVersion' => $wgVersion, |
| 75 | + 'wgVersion' => MW_VERSION, |
76 | 76 | 'wgEnableAPI' => $wgEnableAPI, |
77 | 77 | 'wgEnableWriteAPI' => $wgEnableWriteAPI, |
78 | 78 | 'wgDefaultDateFormat' => $wgContLang->getDefaultDateFormat(), |
Index: trunk/phase3/tests/parserTests.php |
— | — | @@ -30,8 +30,9 @@ |
31 | 31 | require_once( dirname( __FILE__ ) . '/../maintenance/commandLine.inc' ); |
32 | 32 | |
33 | 33 | if ( isset( $options['help'] ) ) { |
| 34 | + $version = MW_VERSION; |
34 | 35 | echo <<<ENDS |
35 | | -MediaWiki $wgVersion parser test suite |
| 36 | +MediaWiki $version parser test suite |
36 | 37 | Usage: php parserTests.php [options...] |
37 | 38 | |
38 | 39 | Options: |