Merge "Http::getProxy() method to get proxy configuration"
[lhc/web/wiklou.git] / includes / skins / QuickTemplate.php
index b28dc51..af2d5da 100644 (file)
@@ -32,7 +32,7 @@ abstract class QuickTemplate {
         * @param Config $config
         */
        function __construct( Config $config = null ) {
-               $this->data = array();
+               $this->data = [];
                $this->translator = new MediaWikiI18N();
                if ( $config === null ) {
                        wfDebug( __METHOD__ . ' was called with no Config instance passed to it' );
@@ -50,6 +50,20 @@ abstract class QuickTemplate {
                $this->data[$name] = $value;
        }
 
+       /**
+       * extends the value of data with name $name with the value $value
+       * @since 1.25
+       * @param string $name
+       * @param mixed $value
+       */
+       public function extend( $name, $value ) {
+               if ( $this->haveData( $name ) ) {
+                       $this->data[$name] = $this->data[$name] . $value;
+               } else {
+                       $this->data[$name] = $value;
+               }
+       }
+
        /**
         * Gets the template data requested
         * @since 1.22