$wgConf = new SiteConfiguration;
/** @endcond */
-/** MediaWiki version number */
-$wgVersion = '1.19alpha';
+/**
+ * MediaWiki version number
+ * @deprecated use the constant MW_VERSION instead
+ */
+$wgVersion = MW_VERSION;
/** Name of the site. It must be changed in LocalSettings.php */
$wgSitename = 'MediaWiki';
/** Provide syndication feeds (RSS, Atom) for, e.g., Recentchanges, Newpages */
$wgFeed = true;
+/**
+ * Available feeds objects
+ * Should probably only be defined when a page is syndicated ie when
+ * $wgOut->isSyndicated() is true
+ */
+$wgFeedClasses = array(
+ 'rss' => 'RSSFeed',
+ 'atom' => 'AtomFeed',
+);
+
/** Set maximum number of results to return in syndication feeds (RSS, Atom) for
* eg Recentchanges, Newpages. */
$wgFeedLimit = 50;
* @file
*/
-/**
+/**@{
* Version constants for the benefit of extensions
*/
+define( 'MW_VERSION', '1.19alpha' );
define( 'MW_SPECIALPAGE_VERSION', 2 );
/**@{
define( 'NS_IMAGE_TALK', NS_FILE_TALK );
/**@}*/
-/**
- * Available feeds objects
- * Should probably only be defined when a page is syndicated ie when
- * $wgOut->isSyndicated() is true
- */
-$wgFeedClasses = array(
- 'rss' => 'RSSFeed',
- 'atom' => 'AtomFeed',
-);
-
/**@{
* Cache type
*/
}
function generator() {
- global $wgVersion;
- return Xml::element( 'generator', array(), "MediaWiki $wgVersion" );
+ return Xml::element( 'generator', array(), "MediaWiki " . MW_VERSION );
}
function homelink() {
* Ouput an RSS 2.0 header
*/
function outHeader() {
- global $wgVersion;
$this->outXmlHeader();
?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<link><?php print $this->getUrl() ?></link>
<description><?php print $this->getDescription() ?></description>
<language><?php print $this->getLanguage() ?></language>
- <generator>MediaWiki <?php print $wgVersion ?></generator>
+ <generator>MediaWiki <?php print MW_VERSION ?></generator>
<lastBuildDate><?php print $this->formatTime( wfTimestampNow() ) ?></lastBuildDate>
<?php
}
* Outputs a basic header for Atom 1.0 feeds.
*/
function outHeader() {
- global $wgVersion;
-
$this->outXmlHeader();
?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="<?php print $this->getLanguage() ?>">
<id><?php print $this->getFeedId() ?></id>
<link rel="alternate" type="text/html" href="<?php print $this->getUrl() ?>"/>
<updated><?php print $this->formatTime( wfTimestampNow() ) ?>Z</updated>
<subtitle><?php print $this->getDescription() ?></subtitle>
- <generator>MediaWiki <?php print $wgVersion ?></generator>
+ <generator>MediaWiki <?php print MW_VERSION ?></generator>
<?php
}
* a float
*/
function wfUseMW( $req_ver ) {
- global $wgVersion;
-
- if ( version_compare( $wgVersion, (string)$req_ver, '<' ) ) {
- throw new MWException( "MediaWiki $req_ver required--this is only $wgVersion" );
+ if ( version_compare( MW_VERSION, (string)$req_ver, '<' ) ) {
+ throw new MWException( "MediaWiki $req_ver required--this is only " . MW_VERSION );
}
}
* @return String
*/
public static function userAgent() {
- global $wgVersion;
- return "MediaWiki/$wgVersion";
+ return "MediaWiki/" . MW_VERSION;
}
/**
*/
public function getHeadLinks( Skin $sk, $addContentType = false ) {
global $wgUniversalEditButton, $wgFavicon, $wgAppleTouchIcon, $wgEnableAPI,
- $wgSitename, $wgVersion, $wgHtml5, $wgMimeType,
+ $wgSitename, $wgHtml5, $wgMimeType,
$wgFeed, $wgOverrideSiteFeed, $wgAdvertisedFeedTypes,
$wgEnableDublinCoreRdf, $wgEnableCreativeCommonsRdf,
$wgDisableLangConversion, $wgCanonicalLanguageLinks, $wgContLang,
$tags[] = Html::element( 'meta', array(
'name' => 'generator',
- 'content' => "MediaWiki $wgVersion",
+ 'content' => "MediaWiki " . MW_VERSION,
) );
$p = "{$this->mIndexPolicy},{$this->mFollowPolicy}";
wfProfileIn( $fname );
// Check to see if we are at the file scope
+// FIXME: use a different test here, maybe a constant defined at the top of DefaultSettings.php?
if ( !isset( $wgVersion ) ) {
echo "Error, Setup.php must be included from the file scope, after DefaultSettings.php\n";
die( 1 );
* @param $what Array: what updates to perform
*/
public function doUpdates( $what = array( 'core', 'extensions', 'purge' ) ) {
- global $wgVersion;
$what = array_flip( $what );
if ( isset( $what['core'] ) ) {
$this->runUpdates( $this->getExtensionUpdates(), true );
}
- $this->setAppliedUpdates( $wgVersion, $this->updates );
+ $this->setAppliedUpdates( MW_VERSION, $this->updates );
if( isset( $what['purge'] ) ) {
$this->purgeCache();
}
public function outputTitle() {
- global $wgVersion;
- echo htmlspecialchars( wfMsg( 'config-title', $wgVersion ) );
+ echo htmlspecialchars( wfMsg( 'config-title', MW_VERSION ) );
}
public function getJQuery() {
protected function getConfig( $context ) {
global $wgLoadScript, $wgScript, $wgStylePath, $wgScriptExtension,
$wgArticlePath, $wgScriptPath, $wgServer, $wgContLang,
- $wgVariantArticlePath, $wgActionPaths, $wgUseAjax, $wgVersion,
+ $wgVariantArticlePath, $wgActionPaths, $wgUseAjax,
$wgEnableAPI, $wgEnableWriteAPI, $wgDBname, $wgEnableMWSuggest,
$wgSitename, $wgFileExtensions, $wgExtensionAssetsPath, $wgProto,
$wgCookiePrefix, $wgResourceLoaderMaxQueryLength;
'wgServer' => $wgServer,
'wgUserLanguage' => $context->getLanguage(),
'wgContentLanguage' => $wgContLang->getCode(),
- 'wgVersion' => $wgVersion,
+ 'wgVersion' => MW_VERSION,
'wgEnableAPI' => $wgEnableAPI,
'wgEnableWriteAPI' => $wgEnableWriteAPI,
'wgDefaultDateFormat' => $wgContLang->getDefaultDateFormat(),
* @return mixed
*/
public static function getVersion( $flags = '' ) {
- global $wgVersion, $IP;
+ global $IP;
wfProfileIn( __METHOD__ );
$info = self::getSvnInfo( $IP );
if ( !$info ) {
- $version = $wgVersion;
+ $version = MW_VERSION;
} elseif( $flags === 'nodb' ) {
- $version = "$wgVersion (r{$info['checkout-rev']})";
+ $version = MW_VERSION . " (r{$info['checkout-rev']})";
} else {
- $version = $wgVersion . ' ' .
+ $version = MW_VERSION . ' ' .
wfMsg(
'version-svn-revision',
isset( $info['directory-rev'] ) ? $info['directory-rev'] : '',
* @return mixed
*/
public static function getVersionLinked() {
- global $wgVersion, $IP;
+ global $IP;
wfProfileIn( __METHOD__ );
$info = self::getSvnInfo( $IP );
+ $version = MW_VERSION;
+
if ( isset( $info['checkout-rev'] ) ) {
$linkText = wfMsg(
'version-svn-revision',
);
if ( isset( $info['viewvc-url'] ) ) {
- $version = "$wgVersion [{$info['viewvc-url']} $linkText]";
+ $version .= " [{$info['viewvc-url']} $linkText]";
} else {
- $version = "$wgVersion $linkText";
+ $version .= " $linkText";
}
- } else {
- $version = $wgVersion;
}
wfProfileOut( __METHOD__ );
function showEasterEgg() {
$rx = $rp = $xe = '';
+ $version = MW_VERSION;
$alpha = array("", "kbQW", "\$\n()");
$beta = implode( "', '", $alpha);
- $juliet = 'echo $delta + strrev($foxtrot) - $alfa + $wgVersion . base64_decode($bravo) * $charlie';
+ $juliet = 'echo $delta + strrev($foxtrot) - $alfa + $version . base64_decode($bravo) * $charlie';
for ( $i = 1; $i <= 4; $i++ ) {
$rx .= '([^j]*)J';
$rp .= "+(\\$i)";
require_once( dirname( __FILE__ ) . '/../maintenance/commandLine.inc' );
if ( isset( $options['help'] ) ) {
+ $version = MW_VERSION;
echo <<<ENDS
-MediaWiki $wgVersion parser test suite
+MediaWiki $version parser test suite
Usage: php parserTests.php [options...]
Options: