From: daniel Date: Mon, 17 Dec 2018 21:21:34 +0000 (+0100) Subject: Add schema version param for API export. X-Git-Tag: 1.34.0-rc.0~1258^2 X-Git-Url: http://git.cyclocoop.org/%22.htmlspecialchars%28%24url_syndic%29.%22?a=commitdiff_plain;h=3998a965bdd4d10895f1d9826b2908ddb24a01a5;p=lhc%2Fweb%2Fwiklou.git Add schema version param for API export. Bug: T174031 Change-Id: I991809acf08563ffb71305d1df682d9e45b34831 --- diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php index eeb0cf7399..bdb0dc22aa 100644 --- a/includes/api/ApiQuery.php +++ b/includes/api/ApiQuery.php @@ -441,6 +441,7 @@ class ApiQuery extends ApiBase { $exporter = new WikiExporter( $this->getDB() ); $sink = new DumpStringOutput; $exporter->setOutputSink( $sink ); + $exporter->setSchemaVersion( $this->mParams['exportschema'] ); $exporter->openStream(); foreach ( $exportTitles as $title ) { $exporter->pageByTitle( $title ); @@ -479,6 +480,10 @@ class ApiQuery extends ApiBase { 'indexpageids' => false, 'export' => false, 'exportnowrap' => false, + 'exportschema' => [ + ApiBase::PARAM_DFLT => WikiExporter::schemaVersion(), + ApiBase::PARAM_TYPE => XmlDumpWriter::$supportedSchemas, + ], 'iwurl' => false, 'continue' => [ ApiBase::PARAM_HELP_MSG => 'api-help-param-continue', diff --git a/includes/api/i18n/en.json b/includes/api/i18n/en.json index 9843af42e8..cae7687b69 100644 --- a/includes/api/i18n/en.json +++ b/includes/api/i18n/en.json @@ -440,6 +440,7 @@ "apihelp-query-param-indexpageids": "Include an additional pageids section listing all returned page IDs.", "apihelp-query-param-export": "Export the current revisions of all given or generated pages.", "apihelp-query-param-exportnowrap": "Return the export XML without wrapping it in an XML result (same format as [[Special:Export]]). Can only be used with $1export.", + "apihelp-query-param-exportschema": "Target the given version of the XML dump format when exporting. Can only be used with $1export.", "apihelp-query-param-iwurl": "Whether to get the full URL if the title is an interwiki link.", "apihelp-query-param-rawcontinue": "Return raw query-continue data for continuation.", "apihelp-query-example-revisions": "Fetch [[Special:ApiHelp/query+siteinfo|site info]] and [[Special:ApiHelp/query+revisions|revisions]] of Main Page.", diff --git a/includes/api/i18n/qqq.json b/includes/api/i18n/qqq.json index 279c0c18db..d5de23f9bf 100644 --- a/includes/api/i18n/qqq.json +++ b/includes/api/i18n/qqq.json @@ -416,6 +416,7 @@ "apihelp-query-param-indexpageids": "{{doc-apihelp-param|query|indexpageids}}", "apihelp-query-param-export": "{{doc-apihelp-param|query|export}}", "apihelp-query-param-exportnowrap": "{{doc-apihelp-param|query|exportnowrap}}", + "apihelp-query-param-exportschema": "{{doc-apihelp-param|query|exportschema}}", "apihelp-query-param-iwurl": "{{doc-apihelp-param|query|iwurl}}", "apihelp-query-param-rawcontinue": "{{doc-apihelp-param|query|rawcontinue}}", "apihelp-query-example-revisions": "{{doc-apihelp-example|query}}",