Merge "mw.Title: Handle empty this.title"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 1 Jul 2015 19:24:21 +0000 (19:24 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 1 Jul 2015 19:24:21 +0000 (19:24 +0000)
12 files changed:
RELEASE-NOTES-1.26
autoload.php
includes/api/ApiFormatBase.php
includes/api/ApiFormatDump.php [deleted file]
includes/api/ApiFormatWddx.php [deleted file]
includes/api/ApiMain.php
includes/api/ApiParse.php
includes/api/ApiQueryRevisionsBase.php
includes/api/i18n/en.json
includes/api/i18n/qqq.json
tests/phpunit/includes/api/format/ApiFormatDumpTest.php [deleted file]
tests/phpunit/includes/api/format/ApiFormatWddxTest.php [deleted file]

index 5675956..aed6de9 100644 (file)
@@ -14,6 +14,7 @@ production.
 * New-style continuation is now the default for API action=continue. Clients may
   use the 'rawcontinue' parameter to receive raw query-continue data, but the
   new style is encouraged as it's harder to implement incorrectly.
+* Deprecated API formats dump and wddx have been completely removed.
 
 === New features in 1.26 ===
 * (T51506) Now action=info gives estimates of actual watchers for a page.
@@ -55,6 +56,7 @@ production.
 * New-style continuation is now the default for action=continue. Clients may
   use the 'rawcontinue' parameter to receive raw query-continue data, but the
   new style is encouraged as it's harder to implement incorrectly.
+* Deprecated API formats dump and wddx have been completely removed.
 * API action=query&list=tags: The displayname can now be boolean false if the
   tag is meant to be hidden from user interfaces.
 * action=import no longer allows both the namespace= and rootpage= parameters
index 9266776..8e4da1e 100644 (file)
@@ -37,14 +37,12 @@ $wgAutoloadLocalClasses = array(
        'ApiFileRevert' => __DIR__ . '/includes/api/ApiFileRevert.php',
        'ApiFormatBase' => __DIR__ . '/includes/api/ApiFormatBase.php',
        'ApiFormatDbg' => __DIR__ . '/includes/api/ApiFormatDbg.php',
-       'ApiFormatDump' => __DIR__ . '/includes/api/ApiFormatDump.php',
        'ApiFormatFeedWrapper' => __DIR__ . '/includes/api/ApiFormatFeedWrapper.php',
        'ApiFormatJson' => __DIR__ . '/includes/api/ApiFormatJson.php',
        'ApiFormatNone' => __DIR__ . '/includes/api/ApiFormatNone.php',
        'ApiFormatPhp' => __DIR__ . '/includes/api/ApiFormatPhp.php',
        'ApiFormatRaw' => __DIR__ . '/includes/api/ApiFormatRaw.php',
        'ApiFormatTxt' => __DIR__ . '/includes/api/ApiFormatTxt.php',
-       'ApiFormatWddx' => __DIR__ . '/includes/api/ApiFormatWddx.php',
        'ApiFormatXml' => __DIR__ . '/includes/api/ApiFormatXml.php',
        'ApiFormatXmlRsd' => __DIR__ . '/includes/api/ApiRsd.php',
        'ApiFormatYaml' => __DIR__ . '/includes/api/ApiFormatYaml.php',
index 47c8128..4d80163 100644 (file)
@@ -246,7 +246,7 @@ abstract class ApiFormatBase extends ApiBase {
        }
 
        /**
-        * To avoid code duplication with the deprecation of dbg, dump, txt, wddx,
+        * To avoid code duplication with the deprecation of dbg, txt
         * and yaml, this method is added to do the necessary work. It should be
         * removed when those deprecated formats are removed.
         */
@@ -312,7 +312,7 @@ abstract class ApiFormatBase extends ApiBase {
                // Escape everything first for full coverage
                $text = htmlspecialchars( $text );
 
-               if ( $this->mFormat === 'XML' || $this->mFormat === 'WDDX' ) {
+               if ( $this->mFormat === 'XML' ) {
                        // encode all comments or tags as safe blue strings
                        $text = str_replace( '&lt;', '<span style="color:blue;">&lt;', $text );
                        $text = str_replace( '&gt;', '&gt;</span>', $text );
diff --git a/includes/api/ApiFormatDump.php b/includes/api/ApiFormatDump.php
deleted file mode 100644 (file)
index f34e1ae..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-/**
- *
- *
- * Created on August 8, 2010
- *
- * Copyright © 2010 Soxred93
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- */
-
-/**
- * API PHP's var_dump() output formatter
- * @deprecated since 1.24
- * @ingroup API
- */
-class ApiFormatDump extends ApiFormatBase {
-
-       public function getMimeType() {
-               // This looks like it should be text/plain, but IE7 is so
-               // brain-damaged it tries to parse text/plain as HTML if it
-               // contains HTML tags. Using MIME text/text works around this bug
-               return 'text/text';
-       }
-
-       public function execute() {
-               $this->markDeprecated();
-               $data = $this->getResult()->getResultData( null, array(
-                       'BC' => array(),
-                       'Types' => array(),
-                       'Strip' => 'all',
-               ) );
-               ob_start();
-               var_dump( $data );
-               $result = ob_get_contents();
-               ob_end_clean();
-               $this->printText( $result );
-       }
-
-       public function isDeprecated() {
-               return true;
-       }
-}
diff --git a/includes/api/ApiFormatWddx.php b/includes/api/ApiFormatWddx.php
deleted file mode 100644 (file)
index c18353f..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-<?php
-/**
- *
- *
- * Created on Oct 22, 2006
- *
- * Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- */
-
-/**
- * API WDDX output formatter
- * @deprecated since 1.24
- * @ingroup API
- */
-class ApiFormatWddx extends ApiFormatBase {
-
-       public function getMimeType() {
-               return 'text/xml';
-       }
-
-       public function execute() {
-               $this->markDeprecated();
-
-               $data = $this->getResult()->getResultData( null, array(
-                       'BC' => array(),
-                       'Types' => array( 'AssocAsObject' => true ),
-                       'Strip' => 'all',
-               ) );
-
-               if ( !$this->getIsHtml() && !static::useSlowPrinter() ) {
-                       $txt = wddx_serialize_value( $data );
-                       $txt = str_replace(
-                               '<struct><var name=\'php_class_name\'><string>stdClass</string></var>',
-                               '<struct>',
-                               $txt
-                       );
-                       $this->printText( $txt );
-               } else {
-                       // Don't do newlines and indentation if we weren't asked
-                       // for pretty output
-                       $nl = ( $this->getIsHtml() ? "\n" : '' );
-                       $indstr = ( $this->getIsHtml() ? ' ' : '' );
-                       $this->printText( "<?xml version=\"1.0\"?>$nl" );
-                       $this->printText( "<wddxPacket version=\"1.0\">$nl" );
-                       $this->printText( "$indstr<header />$nl" );
-                       $this->printText( "$indstr<data>$nl" );
-                       $this->slowWddxPrinter( $data, 4 );
-                       $this->printText( "$indstr</data>$nl" );
-                       $this->printText( "</wddxPacket>$nl" );
-               }
-       }
-
-       public static function useSlowPrinter() {
-               if ( !function_exists( 'wddx_serialize_value' ) ) {
-                       return true;
-               }
-
-               // Some versions of PHP have a broken wddx_serialize_value, see
-               // PHP bug 45314. Test encoding an affected character (U+00A0)
-               // to avoid this.
-               $expected =
-                       "<wddxPacket version='1.0'><header/><data><string>\xc2\xa0</string></data></wddxPacket>";
-               if ( wddx_serialize_value( "\xc2\xa0" ) !== $expected ) {
-                       return true;
-               }
-
-               // Some versions of HHVM don't correctly encode ampersands.
-               $expected =
-                       "<wddxPacket version='1.0'><header/><data><string>&amp;</string></data></wddxPacket>";
-               if ( wddx_serialize_value( '&' ) !== $expected ) {
-                       return true;
-               }
-
-               // Some versions of HHVM don't correctly encode empty arrays as subvalues.
-               $expected =
-                       "<wddxPacket version='1.0'><header/><data><array length='1'><array length='0'></array></array></data></wddxPacket>";
-               if ( wddx_serialize_value( array( array() ) ) !== $expected ) {
-                       return true;
-               }
-
-               // Some versions of HHVM don't correctly encode associative arrays with numeric keys.
-               $expected =
-                       "<wddxPacket version='1.0'><header/><data><struct><var name='2'><number>1</number></var></struct></data></wddxPacket>";
-               if ( wddx_serialize_value( array( 2 => 1 ) ) !== $expected ) {
-                       return true;
-               }
-
-               return false;
-       }
-
-       /**
-        * Recursively go through the object and output its data in WDDX format.
-        * @param mixed $elemValue
-        * @param int $indent
-        */
-       function slowWddxPrinter( $elemValue, $indent = 0 ) {
-               $indstr = ( $this->getIsHtml() ? str_repeat( ' ', $indent ) : '' );
-               $indstr2 = ( $this->getIsHtml() ? str_repeat( ' ', $indent + 2 ) : '' );
-               $nl = ( $this->getIsHtml() ? "\n" : '' );
-
-               if ( is_array( $elemValue ) ) {
-                       $cnt = count( $elemValue );
-                       if ( $cnt != 0 && array_keys( $elemValue ) !== range( 0, $cnt - 1 ) ) {
-                               $elemValue = (object)$elemValue;
-                       }
-               }
-
-               if ( is_array( $elemValue ) ) {
-                       // Regular array
-                       $this->printText( $indstr . Xml::element( 'array', array(
-                               'length' => count( $elemValue ) ), null ) . $nl );
-                       foreach ( $elemValue as $subElemValue ) {
-                               $this->slowWddxPrinter( $subElemValue, $indent + 2 );
-                       }
-                       $this->printText( "$indstr</array>$nl" );
-               } elseif ( is_object( $elemValue ) ) {
-                       // Associative array (<struct>)
-                       $this->printText( "$indstr<struct>$nl" );
-                       foreach ( $elemValue as $subElemName => $subElemValue ) {
-                               $this->printText( $indstr2 . Xml::element( 'var', array(
-                                       'name' => $subElemName
-                               ), null ) . $nl );
-                               $this->slowWddxPrinter( $subElemValue, $indent + 4 );
-                               $this->printText( "$indstr2</var>$nl" );
-                       }
-                       $this->printText( "$indstr</struct>$nl" );
-               } elseif ( is_int( $elemValue ) || is_float( $elemValue ) ) {
-                       $this->printText( $indstr . Xml::element( 'number', null, $elemValue ) . $nl );
-               } elseif ( is_string( $elemValue ) ) {
-                       $this->printText( $indstr . Xml::element( 'string', null, $elemValue, false ) . $nl );
-               } elseif ( is_bool( $elemValue ) ) {
-                       $this->printText( $indstr . Xml::element( 'boolean',
-                               array( 'value' => $elemValue ? 'true' : 'false' ) ) . $nl
-                       );
-               } elseif ( $elemValue === null ) {
-                       $this->printText( $indstr . Xml::element( 'null', array() ) . $nl );
-               } else {
-                       ApiBase::dieDebug( __METHOD__, 'Unknown type ' . gettype( $elemValue ) );
-               }
-       }
-
-       public function isDeprecated() {
-               return true;
-       }
-}
index a8db20c..f2059d7 100644 (file)
@@ -100,8 +100,6 @@ class ApiMain extends ApiBase {
                'jsonfm' => 'ApiFormatJson',
                'php' => 'ApiFormatPhp',
                'phpfm' => 'ApiFormatPhp',
-               'wddx' => 'ApiFormatWddx',
-               'wddxfm' => 'ApiFormatWddx',
                'xml' => 'ApiFormatXml',
                'xmlfm' => 'ApiFormatXml',
                'yaml' => 'ApiFormatYaml',
@@ -111,8 +109,6 @@ class ApiMain extends ApiBase {
                'txtfm' => 'ApiFormatTxt',
                'dbg' => 'ApiFormatDbg',
                'dbgfm' => 'ApiFormatDbg',
-               'dump' => 'ApiFormatDump',
-               'dumpfm' => 'ApiFormatDump',
                'none' => 'ApiFormatNone',
        );
 
index fa6f30e..577b525 100644 (file)
@@ -410,9 +410,12 @@ class ApiParse extends ApiBase {
                        $result_array[ApiResult::META_BC_SUBELEMENTS][] = 'limitreporthtml';
                }
 
-               if ( $params['generatexml'] ) {
+               if ( isset( $prop['parsetree'] ) || $params['generatexml'] ) {
+                       if ( !isset( $prop['parsetree'] ) ) {
+                               $this->logFeatureUsage( 'action=parse&generatexml' );
+                       }
                        if ( $this->content->getModel() != CONTENT_MODEL_WIKITEXT ) {
-                               $this->dieUsage( "generatexml is only supported for wikitext content", "notwikitext" );
+                               $this->dieUsage( "parsetree is only supported for wikitext content", "notwikitext" );
                        }
 
                        $wgParser->startExternalParse( $titleObj, $popts, Parser::OT_PREPROCESS );
@@ -745,8 +748,11 @@ class ApiParse extends ApiBase {
                                        'properties',
                                        'limitreportdata',
                                        'limitreporthtml',
+                                       'parsetree',
+                               ),
+                               ApiBase::PARAM_HELP_MSG_PER_VALUE => array(
+                                       'parsetree' => array( 'apihelp-parse-paramvalue-prop-parsetree', CONTENT_MODEL_WIKITEXT ),
                                ),
-                               ApiBase::PARAM_HELP_MSG_PER_VALUE => array(),
                        ),
                        'pst' => false,
                        'onlypst' => false,
@@ -762,6 +768,7 @@ class ApiParse extends ApiBase {
                                ApiBase::PARAM_HELP_MSG => array(
                                        'apihelp-parse-param-generatexml', CONTENT_MODEL_WIKITEXT
                                ),
+                               ApiBase::PARAM_DEPRECATED => true,
                        ),
                        'preview' => false,
                        'sectionpreview' => false,
index 64f6120..76da0db 100644 (file)
@@ -37,7 +37,7 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
        protected $fld_ids = false, $fld_flags = false, $fld_timestamp = false,
                $fld_size = false, $fld_sha1 = false, $fld_comment = false,
                $fld_parsedcomment = false, $fld_user = false, $fld_userid = false,
-               $fld_content = false, $fld_tags = false, $fld_contentmodel = false;
+               $fld_content = false, $fld_tags = false, $fld_contentmodel = false, $fld_parsetree = false;
 
        public function execute() {
                $this->run();
@@ -104,6 +104,7 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
                $this->fld_userid = isset( $prop['userid'] );
                $this->fld_user = isset( $prop['user'] );
                $this->fld_tags = isset( $prop['tags'] );
+               $this->fld_parsetree = isset( $prop['parsetree'] );
 
                if ( !empty( $params['contentformat'] ) ) {
                        $this->contentFormat = $params['contentformat'];
@@ -112,7 +113,7 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
                $this->limit = $params['limit'];
 
                $this->fetchContent = $this->fld_content || !is_null( $this->diffto )
-                       || !is_null( $this->difftotext );
+                       || !is_null( $this->difftotext ) || $this->fld_parsetree;
 
                $smallLimit = false;
                if ( $this->fetchContent ) {
@@ -273,10 +274,11 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
                                $vals['textmissing'] = true;
                        }
                }
-               if ( $this->fld_content && $content ) {
-                       $text = null;
-
-                       if ( $this->generateXML ) {
+               if ( $this->fld_parsetree || ( $this->fld_content && $this->generateXML ) ) {
+                       if ( !$this->fld_parsetree ) {
+                               $this->logFeatureUsage( 'action=query&prop=revisions+base&generatexml' );
+                       }
+                       if ( $content ) {
                                if ( $content->getModel() === CONTENT_MODEL_WIKITEXT ) {
                                        $t = $content->getNativeData(); # note: don't set $text
 
@@ -299,6 +301,10 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
                                                " uses content model " . $content->getModel() );
                                }
                        }
+               }
+
+               if ( $this->fld_content && $content ) {
+                       $text = null;
 
                        if ( $this->expandTemplates && !$this->parseContent ) {
                                #XXX: implement template expansion for all content types in ContentHandler?
@@ -431,7 +437,8 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
                                        'comment',
                                        'parsedcomment',
                                        'content',
-                                       'tags'
+                                       'tags',
+                                       'parsetree',
                                ),
                                ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-prop',
                        ),
@@ -448,6 +455,7 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
                        ),
                        'generatexml' => array(
                                ApiBase::PARAM_DFLT => false,
+                               ApiBase::PARAM_DEPRECATED => true,
                                ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-generatexml',
                        ),
                        'parse' => array(
index 6d1b1ec..680f9ae 100644 (file)
        "apihelp-parse-paramvalue-prop-properties": "Gives various properties defined in the parsed wikitext.",
        "apihelp-parse-paramvalue-prop-limitreportdata": "Gives the limit report in a structured way. Gives no data, when <var>$1disablepp</var> is set.",
        "apihelp-parse-paramvalue-prop-limitreporthtml": "Gives the HTML version of the limit report. Gives no data, when <var>$1disablepp</var> is set.",
+       "apihelp-parse-paramvalue-prop-parsetree": "The XML parse tree of revision content (requires content model <code>$1</code>)",
        "apihelp-parse-param-pst": "Do a pre-save transform on the input before parsing it. Only valid when used with text.",
        "apihelp-parse-param-onlypst": "Do a pre-save transform (PST) on the input, but don't parse it. Returns the same wikitext, after a PST has been applied. Only valid when used with <var>$1text</var>.",
        "apihelp-parse-param-effectivelanglinks": "Includes language links supplied by extensions (for use with <kbd>$1prop=langlinks</kbd>).",
        "apihelp-parse-param-sectiontitle": "New section title when <var>section</var> is <kbd>new</kbd>.\n\nUnlike page editing, this does not fall back to <var>summary</var> when omitted or empty.",
        "apihelp-parse-param-disablepp": "Disable the PP Report from the parser output.",
        "apihelp-parse-param-disableeditsection": "Disable edit section links from the parser output.",
-       "apihelp-parse-param-generatexml": "Generate XML parse tree (requires content model <code>$1</code>).",
+       "apihelp-parse-param-generatexml": "Generate XML parse tree (requires content model <code>$1</code>; replaced by <kbd>$2prop=parsetree</kbd>).",
        "apihelp-parse-param-preview": "Parse in preview mode.",
        "apihelp-parse-param-sectionpreview": "Parse in section preview mode (enables preview mode too).",
        "apihelp-parse-param-disabletoc": "Disable table of contents in output.",
        "apihelp-query+revisions-example-first5-after": "Get first 5 revisions of the <kbd>Main Page</kbd> made after 2006-05-01.",
        "apihelp-query+revisions-example-first5-not-localhost": "Get first 5 revisions of the <kbd>Main Page</kbd> that were not made by anonymous user <kbd>127.0.0.1</kbd>.",
        "apihelp-query+revisions-example-first5-user": "Get first 5 revisions of the <kbd>Main Page</kbd> that were made by the user <kbd>MediaWiki default</kbd>.",
-       "apihelp-query+revisions+base-param-prop": "Which properties to get for each revision:\n;ids:The ID of the revision.\n;flags:Revision flags (minor).\n;timestamp:The timestamp of the revision.\n;user:User that made the revision.\n;userid:User ID of the revision creator.\n;size:Length (bytes) of the revision.\n;sha1:SHA-1 (base 16) of the revision.\n;contentmodel:Content model ID of the revision.\n;comment:Comment by the user for the revision.\n;parsedcomment:Parsed comment by the user for the revision.\n;content:Text of the revision.\n;tags:Tags for the revision.",
+       "apihelp-query+revisions+base-param-prop": "Which properties to get for each revision:\n;ids:The ID of the revision.\n;flags:Revision flags (minor).\n;timestamp:The timestamp of the revision.\n;user:User that made the revision.\n;userid:User ID of the revision creator.\n;size:Length (bytes) of the revision.\n;sha1:SHA-1 (base 16) of the revision.\n;contentmodel:Content model ID of the revision.\n;comment:Comment by the user for the revision.\n;parsedcomment:Parsed comment by the user for the revision.\n;content:Text of the revision.\n;tags:Tags for the revision.\n;parsetree:The XML parse tree of revision content.",
        "apihelp-query+revisions+base-param-limit": "Limit how many revisions will be returned.",
        "apihelp-query+revisions+base-param-expandtemplates": "Expand templates in revision content (requires $1prop=content).",
-       "apihelp-query+revisions+base-param-generatexml": "Generate XML parse tree for revision content (requires $1prop=content).",
+       "apihelp-query+revisions+base-param-generatexml": "Generate XML parse tree for revision content (requires $1prop=content; replaced by <kbd>$1prop=parsetree</kbd>).",
        "apihelp-query+revisions+base-param-parse": "Parse revision content (requires $1prop=content). For performance reasons, if this option is used, $1limit is enforced to 1.",
        "apihelp-query+revisions+base-param-section": "Only retrieve the content of this section number.",
        "apihelp-query+revisions+base-param-diffto": "Revision ID to diff each revision to. Use <kbd>prev</kbd>, <kbd>next</kbd> and <kbd>cur</kbd> for the previous, next and current revision respectively.",
        "apihelp-format-example-generic": "Format the query result in the $1 format.",
        "apihelp-dbg-description": "Output data in PHP's <code>var_export()</code> format.",
        "apihelp-dbgfm-description": "Output data in PHP's <code>var_export()</code> format (pretty-print in HTML).",
-       "apihelp-dump-description": "Output data in PHP's <code>var_dump()</code> format.",
-       "apihelp-dumpfm-description": "Output data in PHP's <code>var_dump()</code> format (pretty-print in HTML).",
        "apihelp-json-description": "Output data in JSON format.",
        "apihelp-json-param-callback": "If specified, wraps the output into a given function call. For safety, all user-specific data will be restricted.",
        "apihelp-json-param-utf8": "If specified, encodes most (but not all) non-ASCII characters as UTF-8 instead of replacing them with hexadecimal escape sequences. Default when <var>formatversion</var> is not <kbd>1</kbd>.",
        "apihelp-rawfm-description": "Output data with the debugging elements in JSON format (pretty-print in HTML).",
        "apihelp-txt-description": "Output data in PHP's <code>print_r()</code> format.",
        "apihelp-txtfm-description": "Output data in PHP's <code>print_r()</code> format (pretty-print in HTML).",
-       "apihelp-wddx-description": "Output data in WDDX format.",
-       "apihelp-wddxfm-description": "Output data in WDDX format (pretty-print in HTML).",
        "apihelp-xml-description": "Output data in XML format.",
        "apihelp-xml-param-xslt": "If specified, adds the named page as an XSL stylesheet. The value must be a title in the {{ns:mediawiki}} namespace ending in <code>.xsl</code>.",
        "apihelp-xml-param-includexmlnamespace": "If specified, adds an XML namespace.",
index c436d4f..cb5b9a5 100644 (file)
        "apihelp-parse-paramvalue-prop-properties": "{{doc-apihelp-paramvalue|parse|prop|properties}}",
        "apihelp-parse-paramvalue-prop-limitreportdata": "{{doc-apihelp-paramvalue|parse|prop|limitreportdata}}",
        "apihelp-parse-paramvalue-prop-limitreporthtml": "{{doc-apihelp-paramvalue|parse|prop|limitreporthtml}}",
+       "apihelp-parse-paramvalue-prop-parsetree": "{{doc-apihelp-paramvalue|parse|prop|parsetree|params=* $1 - Value of the constant CONTENT_MODEL_WIKITEXT|paramstart=2}}",
        "apihelp-parse-param-pst": "{{doc-apihelp-param|parse|pst}}",
        "apihelp-parse-param-onlypst": "{{doc-apihelp-param|parse|onlypst}}",
        "apihelp-parse-param-effectivelanglinks": "{{doc-apihelp-param|parse|effectivelanglinks}}",
        "apihelp-format-example-generic": "{{doc-apihelp-example|format|params=* $1 - Format name|paramstart=2|noseealso=1}}",
        "apihelp-dbg-description": "{{doc-apihelp-description|dbg|seealso=* {{msg-mw|apihelp-dbgfm-description}}}}",
        "apihelp-dbgfm-description": "{{doc-apihelp-description|dbgfm|seealso=* {{msg-mw|apihelp-dbg-description}}}}",
-       "apihelp-dump-description": "{{doc-apihelp-description|dump|seealso=* {{msg-mw|apihelp-dumpfm-description}}}}",
-       "apihelp-dumpfm-description": "{{doc-apihelp-description|dumpfm|seealso=* {{msg-mw|apihelp-dump-description}}}}",
        "apihelp-json-description": "{{doc-apihelp-description|json|seealso=* {{msg-mw|apihelp-jsonfm-description}}}}",
        "apihelp-json-param-callback": "{{doc-apihelp-param|json|callback}}",
        "apihelp-json-param-utf8": "{{doc-apihelp-param|json|utf8}}",
        "apihelp-rawfm-description": "{{doc-apihelp-description|rawfm|seealso=* {{msg-mw|apihelp-raw-description}}}}",
        "apihelp-txt-description": "{{doc-apihelp-description|txt|seealso=* {{msg-mw|apihelp-txtfm-description}}}}",
        "apihelp-txtfm-description": "{{doc-apihelp-description|txtfm|seealso=* {{msg-mw|apihelp-txt-description}}}}",
-       "apihelp-wddx-description": "{{doc-apihelp-description|wddx|seealso=* {{msg-mw|apihelp-wddxfm-description}}}}",
-       "apihelp-wddxfm-description": "{{doc-apihelp-description|wddxfm|seealso=* {{msg-mw|apihelp-wddx-description}}}}",
        "apihelp-xml-description": "{{doc-apihelp-description|xml|seealso=* {{msg-mw|apihelp-xmlfm-description}}}}",
        "apihelp-xml-param-xslt": "{{doc-apihelp-param|xml|xslt}}",
        "apihelp-xml-param-includexmlnamespace": "{{doc-apihelp-param|xml|includexmlnamespace}}",
diff --git a/tests/phpunit/includes/api/format/ApiFormatDumpTest.php b/tests/phpunit/includes/api/format/ApiFormatDumpTest.php
deleted file mode 100644 (file)
index c0f67f8..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-
-/**
- * @group API
- * @covers ApiFormatDump
- */
-class ApiFormatDumpTest extends ApiFormatTestBase {
-
-       protected $printerName = 'dump';
-
-       public static function provideGeneralEncoding() {
-               // Sigh. Docs claim it's a boolean, but can have values 0, 1, or 2.
-               // Fortunately wfIniGetBool does the right thing.
-               if ( wfIniGetBool( 'xdebug.overload_var_dump' ) ) {
-                       return array(
-                               array( array(), 'Cannot test ApiFormatDump when xDebug overloads var_dump', array( 'SKIP' => true ) ),
-                       );
-               }
-
-               $warning = "\n  [\"warnings\"]=>\n  array(1) {\n    [\"dump\"]=>\n    array(1) {\n      [\"*\"]=>\n" .
-                       "      string(64) \"format=dump has been deprecated. Please use format=json instead.\"\n" .
-                       "    }\n  }";
-
-               return array(
-                       // Basic types
-                       array( array( null ), "array(2) {{$warning}\n  [0]=>\n  NULL\n}\n" ),
-                       array( array( true ), "array(2) {{$warning}\n  [0]=>\n  string(0) \"\"\n}\n" ),
-                       array( array( false ), "array(1) {{$warning}\n}\n" ),
-                       array( array( true, ApiResult::META_BC_BOOLS => array( 0 ) ),
-                               "array(2) {{$warning}\n  [0]=>\n  bool(true)\n}\n" ),
-                       array( array( false, ApiResult::META_BC_BOOLS => array( 0 ) ),
-                               "array(2) {{$warning}\n  [0]=>\n  bool(false)\n}\n" ),
-                       array( array( 42 ), "array(2) {{$warning}\n  [0]=>\n  int(42)\n}\n" ),
-                       array( array( 42.5 ), "array(2) {{$warning}\n  [0]=>\n  float(42.5)\n}\n" ),
-                       array( array( 1e42 ), "array(2) {{$warning}\n  [0]=>\n  float(1.0E+42)\n}\n" ),
-                       array( array( 'foo' ), "array(2) {{$warning}\n  [0]=>\n  string(3) \"foo\"\n}\n" ),
-                       array( array( 'fóo' ), "array(2) {{$warning}\n  [0]=>\n  string(4) \"fóo\"\n}\n" ),
-
-                       // Arrays
-                       array( array( array() ), "array(2) {{$warning}\n  [0]=>\n  array(0) {\n  }\n}\n" ),
-                       array( array( array( 1 ) ), "array(2) {{$warning}\n  [0]=>\n  array(1) {\n    [0]=>\n    int(1)\n  }\n}\n" ),
-                       array( array( array( 'x' => 1 ) ), "array(2) {{$warning}\n  [0]=>\n  array(1) {\n    [\"x\"]=>\n    int(1)\n  }\n}\n" ),
-                       array( array( array( 2 => 1 ) ), "array(2) {{$warning}\n  [0]=>\n  array(1) {\n    [2]=>\n    int(1)\n  }\n}\n" ),
-                       array( array( (object)array() ), "array(2) {{$warning}\n  [0]=>\n  array(0) {\n  }\n}\n" ),
-                       array( array( array( 1, ApiResult::META_TYPE => 'assoc' ) ), "array(2) {{$warning}\n  [0]=>\n  array(1) {\n    [0]=>\n    int(1)\n  }\n}\n" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'array' ) ), "array(2) {{$warning}\n  [0]=>\n  array(1) {\n    [0]=>\n    int(1)\n  }\n}\n" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'kvp' ) ), "array(2) {{$warning}\n  [0]=>\n  array(1) {\n    [\"x\"]=>\n    int(1)\n  }\n}\n" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCkvp', ApiResult::META_KVP_KEY_NAME => 'key' ) ),
-                               "array(2) {{$warning}\n  [0]=>\n  array(1) {\n    [0]=>\n    array(2) {\n      [\"key\"]=>\n      string(1) \"x\"\n      [\"*\"]=>\n      int(1)\n    }\n  }\n}\n" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCarray' ) ), "array(2) {{$warning}\n  [0]=>\n  array(1) {\n    [\"x\"]=>\n    int(1)\n  }\n}\n" ),
-                       array( array( array( 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ) ), "array(2) {{$warning}\n  [0]=>\n  array(2) {\n    [0]=>\n    string(1) \"a\"\n    [1]=>\n    string(1) \"b\"\n  }\n}\n" ),
-
-                       // Content
-                       array( array( 'content' => 'foo', ApiResult::META_CONTENT => 'content' ),
-                               "array(2) {{$warning}\n  [\"*\"]=>\n  string(3) \"foo\"\n}\n" ),
-
-                       // BC Subelements
-                       array( array( 'foo' => 'foo', ApiResult::META_BC_SUBELEMENTS => array( 'foo' ) ),
-                               "array(2) {{$warning}\n  [\"foo\"]=>\n  array(1) {\n    [\"*\"]=>\n    string(3) \"foo\"\n  }\n}\n" ),
-               );
-       }
-
-}
diff --git a/tests/phpunit/includes/api/format/ApiFormatWddxTest.php b/tests/phpunit/includes/api/format/ApiFormatWddxTest.php
deleted file mode 100644 (file)
index 0711130..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-
-/**
- * @group API
- * @covers ApiFormatWddx
- */
-class ApiFormatWddxTest extends ApiFormatTestBase {
-
-       protected $printerName = 'wddx';
-
-       public static function provideGeneralEncoding() {
-               if ( ApiFormatWddx::useSlowPrinter() ) {
-                       return array(
-                               array( array(), 'Fast Wddx printer is unavailable', array( 'SKIP' => true ) )
-                       );
-               }
-               return self::provideEncoding();
-       }
-
-       public static function provideEncoding() {
-               $p = '<wddxPacket version=\'1.0\'><header/><data><struct><var name=\'warnings\'><struct><var name=\'wddx\'><struct><var name=\'*\'><string>format=wddx has been deprecated. Please use format=json instead.</string></var></struct></var></struct></var>';
-               $s = '</struct></data></wddxPacket>';
-
-               return array(
-                       // Basic types
-                       array( array( null ), "{$p}<var name='0'><null/></var>{$s}" ),
-                       array( array( true ), "{$p}<var name='0'><string></string></var>{$s}" ),
-                       array( array( false ), "{$p}{$s}" ),
-                       array( array( true, ApiResult::META_BC_BOOLS => array( 0 ) ),
-                               "{$p}<var name='0'><boolean value='true'/></var>{$s}" ),
-                       array( array( false, ApiResult::META_BC_BOOLS => array( 0 ) ),
-                               "{$p}<var name='0'><boolean value='false'/></var>{$s}" ),
-                       array( array( 42 ), "{$p}<var name='0'><number>42</number></var>{$s}" ),
-                       array( array( 42.5 ), "{$p}<var name='0'><number>42.5</number></var>{$s}" ),
-                       array( array( 1e42 ), "{$p}<var name='0'><number>1.0E+42</number></var>{$s}" ),
-                       array( array( 'foo' ), "{$p}<var name='0'><string>foo</string></var>{$s}" ),
-                       array( array( 'fóo' ), "{$p}<var name='0'><string>fóo</string></var>{$s}" ),
-
-                       // Arrays and objects
-                       array( array( array() ), "{$p}<var name='0'><array length='0'></array></var>{$s}" ),
-                       array( array( array( 1 ) ), "{$p}<var name='0'><array length='1'><number>1</number></array></var>{$s}" ),
-                       array( array( array( 'x' => 1 ) ), "{$p}<var name='0'><struct><var name='x'><number>1</number></var></struct></var>{$s}" ),
-                       array( array( array( 2 => 1 ) ), "{$p}<var name='0'><struct><var name='2'><number>1</number></var></struct></var>{$s}" ),
-                       array( array( (object)array() ), "{$p}<var name='0'><struct></struct></var>{$s}" ),
-                       array( array( array( 1, ApiResult::META_TYPE => 'assoc' ) ), "{$p}<var name='0'><struct><var name='0'><number>1</number></var></struct></var>{$s}" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'array' ) ), "{$p}<var name='0'><array length='1'><number>1</number></array></var>{$s}" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'kvp' ) ), "{$p}<var name='0'><struct><var name='x'><number>1</number></var></struct></var>{$s}" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCkvp', ApiResult::META_KVP_KEY_NAME => 'key' ) ),
-                               "{$p}<var name='0'><array length='1'><struct><var name='key'><string>x</string></var><var name='*'><number>1</number></var></struct></array></var>{$s}" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCarray' ) ), "{$p}<var name='0'><struct><var name='x'><number>1</number></var></struct></var>{$s}" ),
-                       array( array( array( 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ) ), "{$p}<var name='0'><array length='2'><string>a</string><string>b</string></array></var>{$s}" ),
-
-                       // Content
-                       array( array( 'content' => 'foo', ApiResult::META_CONTENT => 'content' ),
-                               "{$p}<var name='*'><string>foo</string></var>{$s}" ),
-
-                       // BC Subelements
-                       array( array( 'foo' => 'foo', ApiResult::META_BC_SUBELEMENTS => array( 'foo' ) ),
-                               "{$p}<var name='foo'><struct><var name='*'><string>foo</string></var></struct></var>{$s}" ),
-               );
-       }
-
-       /**
-        * @dataProvider provideEncoding
-        */
-       public function testSlowEncoding( array $data, $expect, array $params = array() ) {
-               // Adjust expectation for differences between fast and slow printers.
-               $expect = str_replace( '\'', '"', $expect );
-               $expect = str_replace( '/>', ' />', $expect );
-               $expect = '<?xml version="1.0"?>' . $expect;
-
-               $this->assertSame( $expect, $this->encodeData( $params, $data, 'ApiFormatWddxTest_SlowWddx' ) );
-       }
-}
-
-class ApiFormatWddxTest_SlowWddx extends ApiFormatWddx {
-       public static function useSlowPrinter() {
-               return true;
-       }
-}