r99137 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99136‎ | r99137 | r99138 >
Date:20:42, 6 October 2011
Author:catrope
Status:ok
Tags:
Comment:
1.18wmf1: MFT r99135
Modified paths:
  • /branches/wmf/1.18wmf1/RELEASE-NOTES-1.18 (modified) (history)
  • /branches/wmf/1.18wmf1/includes/api/ApiFormatXml.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/RELEASE-NOTES-1.18
@@ -596,6 +596,8 @@
597597 * (bug 28817) Add reference help page link to API Modules
598598 * (bug 29935) Improve formatting of examples in ApiParamInfo
599599 * (bug 29938) list=users&usprop=rights shows rights the user doesn't have
 600+* (bug 24781) The API will include an XML namespace if the includexmlnamespace
 601+ parameter is set.
600602
601603 === Languages updated in 1.18 ===
602604
Property changes on: branches/wmf/1.18wmf1/RELEASE-NOTES-1.18
___________________________________________________________________
Modified: svn:mergeinfo
603605 Merged /trunk/phase3/RELEASE-NOTES-1.18:r99135
Index: branches/wmf/1.18wmf1/includes/api/ApiFormatXml.php
@@ -38,6 +38,7 @@
3939 private $mRootElemName = 'api';
4040 public static $namespace = 'http://www.mediawiki.org/xml/api/';
4141 private $mDoubleQuote = false;
 42+ private $mIncludeNamespace = false;
4243 private $mXslt = null;
4344
4445 public function __construct( $main, $format ) {
@@ -59,15 +60,22 @@
6061 public function execute() {
6162 $params = $this->extractRequestParams();
6263 $this->mDoubleQuote = $params['xmldoublequote'];
 64+ $this->mIncludeNamespace = $params['includexmlnamespace'];
6365 $this->mXslt = $params['xslt'];
6466
6567 $this->printText( '<?xml version="1.0"?>' );
6668 if ( !is_null( $this->mXslt ) ) {
6769 $this->addXslt();
6870 }
 71+ if ( $this->mIncludeNamespace ) {
 72+ $data = array( 'xmlns' => self::$namespace ) + $this->getResultData();
 73+ } else {
 74+ $data = $this->getResultData();
 75+ }
 76+
6977 $this->printText(
7078 self::recXmlPrint( $this->mRootElemName,
71 - array( 'xmlns' => self::$namespace ) + $this->getResultData(),
 79+ $data,
7280 $this->getIsHtml() ? - 2 : null,
7381 $this->mDoubleQuote
7482 )
@@ -201,6 +209,7 @@
202210 return array(
203211 'xmldoublequote' => false,
204212 'xslt' => null,
 213+ 'includexmlnamespace' => false,
205214 );
206215 }
207216
@@ -208,6 +217,7 @@
209218 return array(
210219 'xmldoublequote' => 'If specified, double quotes all attributes and content',
211220 'xslt' => 'If specified, adds <xslt> as stylesheet',
 221+ 'includexmlnamespace' => 'If specified, adds an XML namespace'
212222 );
213223 }
214224

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99135(bug 24781) The API will include an XML namespace if the includexmlnamespace ...btongminh20:11, 6 October 2011

Status & tagging log