X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialVersion.php;h=fbc2c932f44a72b53b9cfd8305ccb201fb1569db;hb=29719f846b8887e1190ddf85125387c079f9539b;hp=5a71ccb5e1f310b513afda7eaeac5d687d4d5154;hpb=c29fd59775f597847a57f598a76de48c63952243;p=lhc%2Fweb%2Fwiklou.git
diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php
index 5a71ccb5e1..fbc2c932f4 100644
--- a/includes/specials/SpecialVersion.php
+++ b/includes/specials/SpecialVersion.php
@@ -80,13 +80,13 @@ class SpecialVersion extends SpecialPage {
* @return string
*/
private static function getMediaWikiCredits() {
- $ret = Xml::element( 'h2', array( 'id' => 'mw-version-license' ), wfMsg( 'version-license' ) );
+ $ret = Xml::element( 'h2', array( 'id' => 'mw-version-license' ), wfMessage( 'version-license' )->text() );
// This text is always left-to-right.
$ret .= '
';
$ret .= "__NOTOC__
" . self::getCopyrightAndAuthorList() . "\n
- " . wfMsg( 'version-license-info' );
+ " . wfMessage( 'version-license-info' )->text();
$ret .= '
';
return str_replace( "\t\t", '', $ret ) . "\n";
@@ -108,11 +108,12 @@ class SpecialVersion extends SpecialPage {
'Alexandre Emsenhuber', 'Siebrand Mazeland', 'Chad Horohoe',
'Roan Kattouw', 'Trevor Parscal', 'Bryan Tong Minh', 'Sam Reed',
'Victor Vasiliev', 'Rotem Liss', 'Platonides', 'Antoine Musso',
- wfMsg( 'version-poweredby-others' )
+ 'Timo Tijhof',
+ wfMessage( 'version-poweredby-others' )->text()
);
- return wfMsg( 'version-poweredby-credits', date( 'Y' ),
- $wgLang->listToText( $authorList ) );
+ return wfMessage( 'version-poweredby-credits', date( 'Y' ),
+ $wgLang->listToText( $authorList ) )->text();
}
/**
@@ -124,8 +125,8 @@ class SpecialVersion extends SpecialPage {
$dbr = wfGetDB( DB_SLAVE );
// Put the software in an array of form 'name' => 'version'. All messages should
- // be loaded here, so feel free to use wfMsg*() in the 'name'. Raw HTML or wikimarkup
- // can be used.
+ // be loaded here, so feel free to use wfMessage in the 'name'. Raw HTML or
+ // wikimarkup can be used.
$software = array();
$software['[https://www.mediawiki.org/ MediaWiki]'] = self::getVersionLinked();
$software['[http://www.php.net/ PHP]'] = phpversion() . " (" . php_sapi_name() . ")";
@@ -134,11 +135,11 @@ class SpecialVersion extends SpecialPage {
// Allow a hook to add/remove items.
wfRunHooks( 'SoftwareInfo', array( &$software ) );
- $out = Xml::element( 'h2', array( 'id' => 'mw-version-software' ), wfMsg( 'version-software' ) ) .
+ $out = Xml::element( 'h2', array( 'id' => 'mw-version-software' ), wfMessage( 'version-software' )->text() ) .
Xml::openElement( 'table', array( 'class' => 'wikitable', 'id' => 'sv-software' ) ) .
"
- " . wfMsg( 'version-software-product' ) . " |
- " . wfMsg( 'version-software-version' ) . " |
+ " . wfMessage( 'version-software-product' )->text() . " |
+ " . wfMessage( 'version-software-version' )->text() . " |
\n";
foreach( $software as $name => $version ) {
@@ -165,6 +166,9 @@ class SpecialVersion extends SpecialPage {
$svnInfo = self::getSvnInfo( $IP );
if ( !$svnInfo && !$gitInfo ) {
$version = $wgVersion;
+ } elseif ( $gitInfo && $flags === 'nodb' ) {
+ $shortSha1 = substr( $gitInfo, 0, 7 );
+ $version = "$wgVersion ($shortSha1)";
} elseif ( $gitInfo ) {
$shortSha1 = substr( $gitInfo, 0, 7 );
$shortSha1 = wfMessage( 'parentheses' )->params( $shortSha1 )->escaped();
@@ -173,11 +177,11 @@ class SpecialVersion extends SpecialPage {
$version = "$wgVersion (r{$svnInfo['checkout-rev']})";
} else {
$version = $wgVersion . ' ' .
- wfMsg(
+ wfMessage(
'version-svn-revision',
isset( $info['directory-rev'] ) ? $info['directory-rev'] : '',
$info['checkout-rev']
- );
+ )->text();
}
wfProfileOut( __METHOD__ );
@@ -223,11 +227,11 @@ class SpecialVersion extends SpecialPage {
return false;
}
- $linkText = wfMsg(
+ $linkText = wfMessage(
'version-svn-revision',
isset( $info['directory-rev'] ) ? $info['directory-rev'] : '',
$info['checkout-rev']
- );
+ )->text();
if ( isset( $info['viewvc-url'] ) ) {
$version = "$wgVersion [{$info['viewvc-url']} $linkText]";
@@ -273,14 +277,14 @@ class SpecialVersion extends SpecialPage {
public static function getExtensionTypes() {
if ( self::$extensionTypes === false ) {
self::$extensionTypes = array(
- 'specialpage' => wfMsg( 'version-specialpages' ),
- 'parserhook' => wfMsg( 'version-parserhooks' ),
- 'variable' => wfMsg( 'version-variables' ),
- 'media' => wfMsg( 'version-mediahandlers' ),
- 'antispam' => wfMsg( 'version-antispam' ),
- 'skin' => wfMsg( 'version-skins' ),
- 'api' => wfMsg( 'version-api' ),
- 'other' => wfMsg( 'version-other' ),
+ 'specialpage' => wfMessage( 'version-specialpages' )->text(),
+ 'parserhook' => wfMessage( 'version-parserhooks' )->text(),
+ 'variable' => wfMessage( 'version-variables' )->text(),
+ 'media' => wfMessage( 'version-mediahandlers' )->text(),
+ 'antispam' => wfMessage( 'version-antispam' )->text(),
+ 'skin' => wfMessage( 'version-skins' )->text(),
+ 'api' => wfMessage( 'version-api' )->text(),
+ 'other' => wfMessage( 'version-other' )->text(),
);
wfRunHooks( 'ExtensionTypes', array( &self::$extensionTypes ) );
@@ -322,7 +326,7 @@ class SpecialVersion extends SpecialPage {
*/
wfRunHooks( 'SpecialVersionExtensionTypes', array( &$this, &$extensionTypes ) );
- $out = Xml::element( 'h2', array( 'id' => 'mw-version-ext' ), wfMsg( 'version-extensions' ) ) .
+ $out = Xml::element( 'h2', array( 'id' => 'mw-version-ext' ), $this->msg( 'version-extensions' )->text() ) .
Xml::openElement( 'table', array( 'class' => 'wikitable', 'id' => 'sv-ext' ) );
// Make sure the 'other' type is set to an array.
@@ -348,7 +352,7 @@ class SpecialVersion extends SpecialPage {
$out .= $this->getExtensionCategory( 'other', $extensionTypes['other'] );
if ( count( $wgExtensionFunctions ) ) {
- $out .= $this->openExtType( wfMsg( 'version-extension-functions' ), 'extension-functions' );
+ $out .= $this->openExtType( $this->msg( 'version-extension-functions' )->text(), 'extension-functions' );
$out .= '' . $this->listToText( $wgExtensionFunctions ) . " |
\n";
}
@@ -359,13 +363,13 @@ class SpecialVersion extends SpecialPage {
for ( $i = 0; $i < $cnt; ++$i ) {
$tags[$i] = "<{$tags[$i]}>";
}
- $out .= $this->openExtType( wfMsg( 'version-parser-extensiontags' ), 'parser-tags' );
+ $out .= $this->openExtType( $this->msg( 'version-parser-extensiontags' )->text(), 'parser-tags' );
$out .= '' . $this->listToText( $tags ). " |
\n";
}
$fhooks = $wgParser->getFunctionHooks();
if( count( $fhooks ) ) {
- $out .= $this->openExtType( wfMsg( 'version-parser-function-hooks' ), 'parser-function-hooks' );
+ $out .= $this->openExtType( $this->msg( 'version-parser-function-hooks' )->text(), 'parser-function-hooks' );
$out .= '' . $this->listToText( $fhooks ) . " |
\n";
}
@@ -444,7 +448,7 @@ class SpecialVersion extends SpecialPage {
# Make subversion text/link.
if ( $svnInfo !== false ) {
$directoryRev = isset( $svnInfo['directory-rev'] ) ? $svnInfo['directory-rev'] : null;
- $vcsText = wfMsg( 'version-svn-revision', $directoryRev, $svnInfo['checkout-rev'] );
+ $vcsText = $this->msg( 'version-svn-revision', $directoryRev, $svnInfo['checkout-rev'] )->text();
$vcsText = isset( $svnInfo['viewvc-url'] ) ? '[' . $svnInfo['viewvc-url'] . " $vcsText]" : $vcsText;
}
}
@@ -459,7 +463,7 @@ class SpecialVersion extends SpecialPage {
if ( isset( $extension['version'] ) ) {
$versionText = '' .
- wfMsg( 'version-version', $extension['version'] ) .
+ $this->msg( 'version-version', $extension['version'] )->text() .
'';
} else {
$versionText = '';
@@ -476,9 +480,9 @@ class SpecialVersion extends SpecialPage {
$descriptionMsgKey = $descriptionMsg[0]; // Get the message key
array_shift( $descriptionMsg ); // Shift out the message key to get the parameters only
array_map( "htmlspecialchars", $descriptionMsg ); // For sanity
- $description = wfMsg( $descriptionMsgKey, $descriptionMsg );
+ $description = $this->msg( $descriptionMsgKey, $descriptionMsg )->text();
} else {
- $description = wfMsg( $descriptionMsg );
+ $description = $this->msg( $descriptionMsg )->text();
}
}
@@ -511,11 +515,11 @@ class SpecialVersion extends SpecialPage {
$myWgHooks = $wgHooks;
ksort( $myWgHooks );
- $ret = Xml::element( 'h2', array( 'id' => 'mw-version-hooks' ), wfMsg( 'version-hooks' ) ) .
+ $ret = Xml::element( 'h2', array( 'id' => 'mw-version-hooks' ), $this->msg( 'version-hooks' )->text() ) .
Xml::openElement( 'table', array( 'class' => 'wikitable', 'id' => 'sv-hooks' ) ) .
"
- " . wfMsg( 'version-hook-name' ) . " |
- " . wfMsg( 'version-hook-subscribedby' ) . " |
+ " . $this->msg( 'version-hook-name' )->text() . " |
+ " . $this->msg( 'version-hook-subscribedby' )->text() . " |
\n";
foreach ( $myWgHooks as $hook => $hooks ) {
@@ -571,7 +575,7 @@ class SpecialVersion extends SpecialPage {
$list = array();
foreach( (array)$authors as $item ) {
if( $item == '...' ) {
- $list[] = wfMsg( 'version-poweredby-others' );
+ $list[] = $this->msg( 'version-poweredby-others' )->text();
} else {
$list[] = $item;
}
@@ -755,11 +759,11 @@ class SpecialVersion extends SpecialPage {
'version-entrypoints-load-php' => wfScript( 'load' ),
);
- $out = Html::element( 'h2', array( 'id' => 'mw-version-entrypoints' ), wfMsg( 'version-entrypoints' ) ) .
+ $out = Html::element( 'h2', array( 'id' => 'mw-version-entrypoints' ), $this->msg( 'version-entrypoints' )->text() ) .
Html::openElement( 'table', array( 'class' => 'wikitable', 'id' => 'mw-version-entrypoints-table' ) ) .
Html::openElement( 'tr' ) .
- Html::element( 'th', array(), wfMessage( 'version-entrypoints-header-entrypoint' )->text() ) .
- Html::element( 'th', array(), wfMessage( 'version-entrypoints-header-url' )->text() ) .
+ Html::element( 'th', array(), $this->msg( 'version-entrypoints-header-entrypoint' )->text() ) .
+ Html::element( 'th', array(), $this->msg( 'version-entrypoints-header-url' )->text() ) .
Html::closeElement( 'tr' );
foreach ( $entryPoints as $message => $value ) {
@@ -767,7 +771,7 @@ class SpecialVersion extends SpecialPage {
$out .= Html::openElement( 'tr' ) .
// ->text() looks like it should be ->parse(), but this function
// returns wikitext, not HTML, boo
- Html::rawElement( 'td', array(), wfMessage( $message )->text() ) .
+ Html::rawElement( 'td', array(), $this->msg( $message )->text() ) .
Html::rawElement( 'td', array(), Html::rawElement( 'code', array(), "[$url $value]" ) ) .
Html::closeElement( 'tr' );
}