dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Create a custom log formatter that allows log entries to contain wikitext"
[lhc/web/wiklou.git]
/
includes
/
skins
/
QuickTemplate.php
diff --git
a/includes/skins/QuickTemplate.php
b/includes/skins/QuickTemplate.php
index
d1be4bb
..
1886746
100644
(file)
--- a/
includes/skins/QuickTemplate.php
+++ b/
includes/skins/QuickTemplate.php
@@
-91,17
+91,24
@@
abstract class QuickTemplate {
}
/**
}
/**
+ * @deprecated since 1.31 This function is a now-redundant optimisation intended
+ * for very old versions of PHP. The use of references here makes the code
+ * more fragile and is incompatible with plans like T140664. Use set() instead.
* @param string $name
* @param mixed &$value
*/
public function setRef( $name, &$value ) {
* @param string $name
* @param mixed &$value
*/
public function setRef( $name, &$value ) {
+ wfDeprecated( __METHOD__, '1.31' );
$this->data[$name] =& $value;
}
/**
* @param MediaWikiI18N &$t
$this->data[$name] =& $value;
}
/**
* @param MediaWikiI18N &$t
+ * @deprecate since 1.31 Use BaseTemplate::msg() or Skin::msg() instead for setting
+ * message parameters.
*/
public function setTranslator( &$t ) {
*/
public function setTranslator( &$t ) {
+ wfDeprecated( __METHOD__, '1.31' );
$this->translator = &$t;
}
$this->translator = &$t;
}
@@
-129,29
+136,29
@@
abstract class QuickTemplate {
/**
* @private
/**
* @private
- * @param string $
str
+ * @param string $
msgKey
*/
*/
- function msg( $
str
) {
- echo htmlspecialchars(
$this->translator->translate( $str
) );
+ function msg( $
msgKey
) {
+ echo htmlspecialchars(
wfMessage( $msgKey )->text(
) );
}
/**
* @private
}
/**
* @private
- * @param string $
str
+ * @param string $
msgKey
*/
*/
- function msgHtml( $
str
) {
- echo
$this->translator->translate( $str
);
+ function msgHtml( $
msgKey
) {
+ echo
wfMessage( $msgKey )->text(
);
}
/**
* An ugly, ugly hack.
* @private
}
/**
* An ugly, ugly hack.
* @private
- * @param string $
str
+ * @param string $
msgKey
*/
*/
- function msgWiki( $
str
) {
+ function msgWiki( $
msgKey
) {
global $wgOut;
global $wgOut;
- $text =
$this->translator->translate( $str
);
+ $text =
wfMessage( $msgKey )->text(
);
echo $wgOut->parse( $text );
}
echo $wgOut->parse( $text );
}
@@
-167,12
+174,12
@@
abstract class QuickTemplate {
/**
* @private
*
/**
* @private
*
- * @param string $
str
+ * @param string $
msgKey
* @return bool
*/
* @return bool
*/
- function haveMsg( $
str
) {
- $msg =
$this->translator->translate( $str
);
- return
( $msg != '-' ) && ( $msg != '' ); # ????
+ function haveMsg( $
msgKey
) {
+ $msg =
wfMessage( $msgKey
);
+ return
$msg->exists() && !$msg->isDisabled();
}
/**
}
/**