skins: Deprecate QuickTemplate::setRef()
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 26 Jan 2018 18:16:13 +0000 (10:16 -0800)
committerKrinkle <krinklemail@gmail.com>
Wed, 31 Jan 2018 21:13:18 +0000 (21:13 +0000)
Removed all use from core. It was only used in a handful of other
repos, most of which have been updated already.

Bug: T140664
Change-Id: I6b1ea3221022597ca38a5cd40eee040d34d1abb8

RELEASE-NOTES-1.31
includes/skins/QuickTemplate.php

index 264113e..f4e81b9 100644 (file)
@@ -190,6 +190,10 @@ changes to languages because of Phabricator reports.
   * PreparedEdit->newText
   * PreparedEdit->oldText
   * PreparedEdit->pst
+* QuickTemplate::setRef() was deprecated in favour of QuickTemplate::set().
+  Setting template variables by reference allowed violating the principle of data being
+  immutable once added to the skin template. In practice, this method was not being
+  used for that. Rather, setRef() existed as memory optimisation for PHP 4.
 
 == Compatibility ==
 MediaWiki 1.31 requires PHP 5.5.9 or later. Although HHVM 3.18.5 or later is supported,
index d1be4bb..19b41ba 100644 (file)
@@ -91,10 +91,14 @@ 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 ) {
+               wfDeprecated( __METHOD__, '1.31' );
                $this->data[$name] =& $value;
        }