From: Siebrand Mazeland
Date: Tue, 21 Aug 2012 19:58:47 +0000 (+0200)
Subject: Replace deprecated wfMsg* calls with Message class calls.
X-Git-Tag: 1.31.0-rc.0~22637^2
X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=c848f486bcc6065826b3f322a60361d0bdf76949;p=lhc%2Fweb%2Fwiklou.git
Replace deprecated wfMsg* calls with Message class calls.
Doing this in steps of roughly 100 changes per commit, so that it remains
reviewable. This should be the one but last change set with the "easy"
ones for core.
Change-Id: If894a92dd65b2f5f4f096b9133685eb3b067a1d8
---
diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php
index 8aac2f4780..c63ae8ac67 100644
--- a/includes/api/ApiParse.php
+++ b/includes/api/ApiParse.php
@@ -425,7 +425,7 @@ class ApiParse extends ApiBase {
$text == '' ? $l : $text );
}
- $s .= implode( htmlspecialchars( wfMsgExt( 'pipe-separator', 'escapenoentities' ) ), $langs );
+ $s .= implode( wfMessage( 'pipe-separator' )->escaped(), $langs );
if ( $wgContLang->isRTL() ) {
$s = Html::rawElement( 'span', array( 'dir' => "LTR" ), $s );
diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php
index bc514b35c7..f2fd42519c 100644
--- a/includes/api/ApiQueryLogEvents.php
+++ b/includes/api/ApiQueryLogEvents.php
@@ -359,7 +359,7 @@ class ApiQueryLogEvents extends ApiQueryBase {
public function getCacheMode( $params ) {
if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) {
- // formatComment() calls wfMsg() among other things
+ // formatComment() calls wfMessage() among other things
return 'anon-public-user-private';
} else {
return 'public';
diff --git a/includes/api/ApiQueryProtectedTitles.php b/includes/api/ApiQueryProtectedTitles.php
index 5e270e0a31..14aed28d7a 100644
--- a/includes/api/ApiQueryProtectedTitles.php
+++ b/includes/api/ApiQueryProtectedTitles.php
@@ -139,7 +139,7 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase {
public function getCacheMode( $params ) {
if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) {
- // formatComment() calls wfMsg() among other things
+ // formatComment() calls wfMessage() among other things
return 'anon-public-user-private';
} else {
return 'public';
diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php
index 7bb6bc5140..7ae4f371ab 100644
--- a/includes/api/ApiQueryRecentChanges.php
+++ b/includes/api/ApiQueryRecentChanges.php
@@ -503,7 +503,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
return 'private';
}
if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) {
- // formatComment() calls wfMsg() among other things
+ // formatComment() calls wfMessage() among other things
return 'anon-public-user-private';
}
return 'public';
diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php
index 18a6cd419a..b89a8ea983 100644
--- a/includes/api/ApiQueryRevisions.php
+++ b/includes/api/ApiQueryRevisions.php
@@ -548,7 +548,7 @@ class ApiQueryRevisions extends ApiQueryBase {
return 'private';
}
if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) {
- // formatComment() calls wfMsg() among other things
+ // formatComment() calls wfMessage() among other things
return 'anon-public-user-private';
}
return 'public';
diff --git a/includes/installer/DatabaseInstaller.php b/includes/installer/DatabaseInstaller.php
index 0beedfa462..de59b2d65f 100644
--- a/includes/installer/DatabaseInstaller.php
+++ b/includes/installer/DatabaseInstaller.php
@@ -334,7 +334,7 @@ abstract class DatabaseInstaller {
* @return String
*/
public function getReadableName() {
- return wfMsg( 'config-type-' . $this->getName() );
+ return wfMessage( 'config-type-' . $this->getName() )->text();
}
/**
@@ -509,7 +509,7 @@ abstract class DatabaseInstaller {
public function getInstallUserBox() {
return
Html::openElement( 'fieldset' ) .
- Html::element( 'legend', array(), wfMsg( 'config-db-install-account' ) ) .
+ Html::element( 'legend', array(), wfMessage( 'config-db-install-account' )->text() ) .
$this->getTextBox( '_InstallUser', 'config-db-username', array( 'dir' => 'ltr' ), $this->parent->getHelpBox( 'config-db-install-username' ) ) .
$this->getPasswordBox( '_InstallPassword', 'config-db-password', array( 'dir' => 'ltr' ), $this->parent->getHelpBox( 'config-db-install-password' ) ) .
Html::closeElement( 'fieldset' );
@@ -534,7 +534,7 @@ abstract class DatabaseInstaller {
public function getWebUserBox( $noCreateMsg = false ) {
$wrapperStyle = $this->getVar( '_SameAccount' ) ? 'display: none' : '';
$s = Html::openElement( 'fieldset' ) .
- Html::element( 'legend', array(), wfMsg( 'config-db-web-account' ) ) .
+ Html::element( 'legend', array(), wfMessage( 'config-db-web-account' )->text() ) .
$this->getCheckBox(
'_SameAccount', 'config-db-web-account-same',
array( 'class' => 'hideShowRadio', 'rel' => 'dbOtherAccount' )
@@ -544,7 +544,7 @@ abstract class DatabaseInstaller {
$this->getPasswordBox( 'wgDBpassword', 'config-db-password' ) .
$this->parent->getHelpBox( 'config-db-web-help' );
if ( $noCreateMsg ) {
- $s .= $this->parent->getWarningBox( wfMsgNoTrans( $noCreateMsg ) );
+ $s .= $this->parent->getWarningBox( wfMessage( $noCreateMsg )->plain() );
} else {
$s .= $this->getCheckBox( '_CreateDBAccount', 'config-db-web-create' );
}
diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php
index d87f294e32..cbede1ec88 100644
--- a/includes/installer/Installer.php
+++ b/includes/installer/Installer.php
@@ -308,7 +308,7 @@ abstract class Installer {
/**
* UI interface for displaying a short message
- * The parameters are like parameters to wfMsg().
+ * The parameters are like parameters to wfMessage().
* The messages will be in wikitext format, which will be converted to an
* output format such as HTML or text before being sent to the user.
* @param $msg
@@ -645,7 +645,7 @@ abstract class Installer {
$allNames = array();
foreach ( self::getDBTypes() as $name ) {
- $allNames[] = wfMsg( "config-type-$name" );
+ $allNames[] = wfMessage( "config-type-$name" )->text();
}
// cache initially available databases to make sure that everything will be displayed correctly
@@ -1585,12 +1585,13 @@ abstract class Installer {
$status = Status::newGood();
try {
$page = WikiPage::factory( Title::newMainPage() );
- $page->doEdit( wfMsgForContent( 'mainpagetext' ) . "\n\n" .
- wfMsgForContent( 'mainpagedocfooter' ),
- '',
- EDIT_NEW,
- false,
- User::newFromName( 'MediaWiki default' ) );
+ $page->doEdit( wfMessage( 'mainpagetext' )->inContentLanguage()->text() . "\n\n" .
+ wfMessage( 'mainpagedocfooter' )->inContentLanguage()->text(),
+ '',
+ EDIT_NEW,
+ false,
+ User::newFromName( 'MediaWiki default' )
+ );
} catch (MWException $e) {
//using raw, because $wgShowExceptionDetails can not be set yet
$status->fatal( 'config-install-mainpage-failed', $e->getMessage() );
diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php
index 4f31195e84..e1c5c29961 100644
--- a/includes/installer/WebInstaller.php
+++ b/includes/installer/WebInstaller.php
@@ -369,7 +369,7 @@ class WebInstaller extends Installer {
}
/**
- * Show an error message in a box. Parameters are like wfMsg().
+ * Show an error message in a box. Parameters are like wfMessage().
* @param $msg
*/
public function showError( $msg /*...*/ ) {
@@ -540,7 +540,7 @@ class WebInstaller extends Installer {
$s .= $this->getPageListItem( 'Restart', true, $currentPageName );
$s .= "\n"; // end list pane
$s .= Html::element( 'h2', array(),
- wfMsg( 'config-page-' . strtolower( $currentPageName ) ) );
+ wfMessage( 'config-page-' . strtolower( $currentPageName ) )->text() );
$this->output->addHTMLNoFlush( $s );
}
@@ -556,7 +556,7 @@ class WebInstaller extends Installer {
*/
private function getPageListItem( $pageName, $enabled, $currentPageName ) {
$s = "
";
- $name = wfMsg( 'config-page-' . strtolower( $pageName ) );
+ $name = wfMessage( 'config-page-' . strtolower( $pageName ) )->text();
if ( $enabled ) {
$query = array( 'page' => $pageName );
@@ -609,7 +609,7 @@ class WebInstaller extends Installer {
/**
* Get HTML for an error box with an icon.
*
- * @param $text String: wikitext, get this with wfMsgNoTrans()
+ * @param $text String: wikitext, get this with wfMessage()->plain()
*
* @return string
*/
@@ -620,7 +620,7 @@ class WebInstaller extends Installer {
/**
* Get HTML for a warning box with an icon.
*
- * @param $text String: wikitext, get this with wfMsgNoTrans()
+ * @param $text String: wikitext, get this with wfMessage()->plain()
*
* @return string
*/
@@ -631,7 +631,7 @@ class WebInstaller extends Installer {
/**
* Get HTML for an info box with an icon.
*
- * @param $text String: wikitext, get this with wfMsgNoTrans()
+ * @param $text String: wikitext, get this with wfMessage()->plain()
* @param $icon String: icon name, file in skins/common/images
* @param $class String: additional class name to add to the wrapper div
*
@@ -640,13 +640,13 @@ class WebInstaller extends Installer {
public function getInfoBox( $text, $icon = false, $class = false ) {
$text = $this->parse( $text, true );
$icon = ( $icon == false ) ? '../skins/common/images/info-32.png' : '../skins/common/images/'.$icon;
- $alt = wfMsg( 'config-information' );
+ $alt = wfMessage( 'config-information' )->text();
return Html::infoBox( $text, $icon, $alt, $class, false );
}
/**
* Get small text indented help for a preceding form field.
- * Parameters like wfMsg().
+ * Parameters like wfMessage().
*
* @param $msg
* @return string
@@ -659,14 +659,15 @@ class WebInstaller extends Installer {
$html = $this->parse( $text, true );
return "