*/
var $sink;
+ /**
+ * Returns the export schema version.
+ * @return string
+ */
+ public static function schemaVersion() {
+ return "0.7"; #FIXME: bump this when pushing ContentHandler additions.
+ }
+
/**
* If using WikiExporter::STREAM to stream a large amount of data,
* provide a database connection which is not managed by
class XmlDumpWriter {
/**
* Returns the export schema version.
+ * @deprecated in 1.20; use WikiExporter::schemaVersion() instead
* @return string
*/
function schemaVersion() {
- return "0.8"; #FIXME: Make sure to bump this to > 0.7 when merging Wikidata branch!
+ wfDeprecated( __METHOD__, '1.20' );
+ return WikiExporter::schemaVersion();
}
/**
- * Opens the XML output stream's root <mediawiki> element.
+ * Opens the XML output stream's root "<mediawiki>" element.
* This does not include an xml directive, so is safe to include
* as a subelement in a larger XML stream. Namespace and XML Schema
* references are included.
*/
function openStream() {
global $wgLanguageCode;
- $ver = $this->schemaVersion();
+ $ver = WikiExporter::schemaVersion();
return Xml::element( 'mediawiki', array(
'xmlns' => "http://www.mediawiki.org/xml/export-$ver/",
'xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance",
}
/**
- * Opens a <page> section on the output stream, with data
+ * Opens a "<page>" section on the output stream, with data
* from the given database row.
*
* @param $row object
}
/**
- * Closes a <page> section on the output stream.
+ * Closes a "<page>" section on the output stream.
*
* @access private
* @return string
}
/**
- * Dumps a <revision> section on the output stream, with
+ * Dumps a "<revision>" section on the output stream, with
* data filled in from the given database row.
*
* @param $row object
}
/**
- * Dumps a <logitem> section on the output stream, with
+ * Dumps a "<logitem>" section on the output stream, with
* data filled in from the given database row.
*
* @param $row object
/**
* @param $timestamp string
+ * @param $indent string Default to six spaces
* @return string
*/
function writeTimestamp( $timestamp, $indent = " " ) {
/**
* @param $id
* @param $text string
+ * @param $indent string Default to six spaces
* @return string
*/
function writeContributor( $id, $text, $indent = " " ) {
* @return string
*/
function writeUploads( $row, $dumpContents = false ) {
- if ( $row->page_namespace == NS_IMAGE ) {
+ if ( $row->page_namespace == NS_FILE ) {
$img = wfLocalFile( $row->page_title );
if ( $img && $img->exists() ) {
$out = '';
* Return prefixed text form of title, but using the content language's
* canonical namespace. This skips any special-casing such as gendered
* user namespaces -- which while useful, are not yet listed in the
- * XML <siteinfo> data so are unsafe in export.
+ * XML "<siteinfo>" data so are unsafe in export.
*
* @param Title $title
* @return string