Merge "Clean up mediawiki.legacy.protect a bit."
[lhc/web/wiklou.git] / includes / Export.php
index e57fe7f..48a814d 100644 (file)
@@ -41,7 +41,7 @@ class WikiExporter {
        public $dumpUploadFileContents = false;
 
        /** @var string */
-       protected $author_list = "";
+       public $author_list = "";
 
        const FULL = 1;
        const CURRENT = 2;
@@ -56,20 +56,20 @@ class WikiExporter {
        const STUB = 1;
 
        /** @var int */
-       protected $buffer;
+       public $buffer;
 
        /** @var int */
-       protected $text;
+       public $text;
 
        /** @var DumpOutput */
-       protected $sink;
+       public $sink;
 
        /**
         * Returns the export schema version.
         * @return string
         */
        public static function schemaVersion() {
-               return "0.8";
+               return "0.9";
        }
 
        /**
@@ -507,8 +507,17 @@ class XmlDumpWriter {
                return Xml::element( 'mediawiki', array(
                        'xmlns'              => "http://www.mediawiki.org/xml/export-$ver/",
                        'xmlns:xsi'          => "http://www.w3.org/2001/XMLSchema-instance",
+                       /*
+                        * When a new version of the schema is created, it needs staging on mediawiki.org.
+                        * This requires a change in the operations/mediawiki-config git repo.
+                        *
+                        * Create a changeset like https://gerrit.wikimedia.org/r/#/c/149643/ in which
+                        * you copy in the new xsd file.
+                        *
+                        * After it is reviewed, merged and deployed (sync-docroot), the index.html needs purging.
+                        * echo "http://www.mediawiki.org/xml/index.html" | mwscript purgeList.php --wiki=aawiki
+                        */
                        'xsi:schemaLocation' => "http://www.mediawiki.org/xml/export-$ver/ " .
-                               #TODO: how do we get a new version up there?
                                "http://www.mediawiki.org/xml/export-$ver.xsd",
                        'version'            => $ver,
                        'xml:lang'           => $wgLanguageCode ),
@@ -523,6 +532,7 @@ class XmlDumpWriter {
        function siteInfo() {
                $info = array(
                        $this->sitename(),
+                       $this->dbname(),
                        $this->homelink(),
                        $this->generator(),
                        $this->caseSetting(),
@@ -540,6 +550,14 @@ class XmlDumpWriter {
                return Xml::element( 'sitename', array(), $wgSitename );
        }
 
+       /**
+        * @return string
+        */
+       function dbname() {
+               global $wgDBname;
+               return Xml::element( 'dbname', array(), $wgDBname );
+       }
+
        /**
         * @return string
         */
@@ -1352,10 +1370,10 @@ class DumpNotalkFilter extends DumpFilter {
  */
 class DumpNamespaceFilter extends DumpFilter {
        /** @var bool */
-       protected $invert = false;
+       public $invert = false;
 
        /** @var array */
-       protected $namespaces = array();
+       public $namespaces = array();
 
        /**
         * @param DumpOutput $sink
@@ -1419,13 +1437,13 @@ class DumpNamespaceFilter extends DumpFilter {
  * @ingroup Dump
  */
 class DumpLatestFilter extends DumpFilter {
-       protected $page;
+       public $page;
 
-       protected $pageString;
+       public $pageString;
 
-       protected $rev;
+       public $rev;
 
-       protected $revString;
+       public $revString;
 
        /**
         * @param object $page