(bug 41716) Add variant config to siprop=general
authorMark Holmquist <mtraceur@member.fsf.org>
Wed, 20 Feb 2013 19:15:35 +0000 (11:15 -0800)
committerMark Holmquist <mtraceur@member.fsf.org>
Mon, 25 Feb 2013 18:11:45 +0000 (10:11 -0800)
Parsoid again needs some extra information, this time so we can support
language variant conversion on our side of things. Added to properties to the
general siteinfo property.

Change-Id: I1ec7da2ec5b08228e74fec4fb366dae26cab8936

includes/api/ApiQuerySiteinfo.php

index 624711a..19382f8 100644 (file)
@@ -114,7 +114,9 @@ class ApiQuerySiteinfo extends ApiQueryBase {
        }
 
        protected function appendGeneralInfo( $property ) {
-               global $wgContLang;
+               global $wgContLang,
+                       $wgDisableLangConversion,
+                       $wgDisableTitleConversion;
 
                $data = array();
                $mainPage = Title::newMainPage();
@@ -127,6 +129,14 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                $data['dbtype'] = $GLOBALS['wgDBtype'];
                $data['dbversion'] = $this->getDB()->getServerVersion();
 
+               if ( !$wgDisableLangConversion ) {
+                       $data['langconversion'] = '';
+               }
+
+               if ( !$wgDisableTitleConversion ) {
+                       $data['titleconversion'] = '';
+               }
+
                $git = SpecialVersion::getGitHeadSha1( $GLOBALS['IP'] );
                if ( $git ) {
                        $data['git-hash'] = $git;