Expose server name in rc feed
authorOri Livneh <ori@wikimedia.org>
Tue, 6 May 2014 01:07:16 +0000 (18:07 -0700)
committerKrinkle <krinklemail@gmail.com>
Fri, 9 May 2014 09:55:00 +0000 (09:55 +0000)
Reviewers of Id819246a9 (Tim, Timo, Chad) have commented that it
would be preferable to identify wikis by their canonical hostname
rather than the value of $wgDBname. Exposing it here so that
the rcstream server can filter subscriptions by it.

Change-Id: I503a0134a8613daddaae9d8df29a1e27fbfd93bc

includes/rcfeed/MachineReadableRCFeedFormatter.php

index e5077a2..3f17bcd 100644 (file)
@@ -38,7 +38,7 @@ abstract class MachineReadableRCFeedFormatter implements RCFeedFormatter {
         * @see RCFeedFormatter::getLine
         */
        public function getLine( array $feed, RecentChange $rc, $actionComment ) {
-               global $wgCanonicalServer, $wgScriptPath;
+               global $wgCanonicalServer, $wgServerName, $wgScriptPath;
                $attrib = $rc->getAttributes();
 
                $packet = array(
@@ -120,6 +120,8 @@ abstract class MachineReadableRCFeedFormatter implements RCFeedFormatter {
                }
 
                $packet['server_url'] = $wgCanonicalServer;
+               $packet['server_name'] = $wgServerName;
+
                $packet['server_script_path'] = $wgScriptPath ?: '/';
                $packet['wiki'] = wfWikiID();