Expose $wgLocalInterwikis via the API
authorThis, that and the other <at.light@live.com.au>
Sun, 22 Jun 2014 05:26:28 +0000 (15:26 +1000)
committerThis, that and the other <at.light@live.com.au>
Sun, 22 Jun 2014 05:26:28 +0000 (15:26 +1000)
This will hopefully be useful to Parsoid.

Bug: 66709
Change-Id: I67d789172d4c6b786ed781f80e513692b3ae4119

includes/api/ApiQuerySiteinfo.php

index a420b37..aacf091 100644 (file)
@@ -385,6 +385,7 @@ class ApiQuerySiteinfo extends ApiQueryBase {
 
                $getPrefixes = Interwiki::getAllPrefixes( $local );
                $extraLangPrefixes = $this->getConfig()->get( 'ExtraInterlanguageLinkPrefixes' );
+               $localInterwikis = $this->getConfig()->get( 'LocalInterwikis' );
                $data = array();
 
                foreach ( $getPrefixes as $row ) {
@@ -401,6 +402,9 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                        if ( isset( $langNames[$prefix] ) ) {
                                $val['language'] = $langNames[$prefix];
                        }
+                       if ( in_array( $prefix, $localInterwikis ) ) {
+                               $val['localinterwiki'] = '';
+                       }
                        if ( in_array( $prefix, $extraLangPrefixes ) ) {
                                $val['extralanglink'] = '';