X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FExport.php;h=84f5c60cecfbd16a7e758af01308fa35aba98622;hb=35eb9481a2e5eaa433b2726adc04e863f018cf40;hp=fafc3fbeb04c0682e38f52ef355d3ec8c9c1136e;hpb=484fce617599f79d27b13f7822240ccf9d8721e7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Export.php b/includes/Export.php index fafc3fbeb0..84f5c60cec 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -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"; } /** @@ -267,7 +267,7 @@ class WikiExporter { if ( $this->buffer == WikiExporter::STREAM ) { $prev = $this->db->bufferResults( false ); } - $wrapper = null; // Assuring $wrapper is not undefined, if exception occurs early + $result = null; // Assuring $result is not undefined, if exception occurs early try { $result = $this->db->select( array( 'logging', 'user' ), array( "{$logging}.*", 'user_name' ), // grab the user name @@ -275,8 +275,7 @@ class WikiExporter { __METHOD__, array( 'ORDER BY' => 'log_id', 'USE INDEX' => array( 'logging' => 'PRIMARY' ) ) ); - $wrapper = $this->db->resultObject( $result ); - $this->outputLogStream( $wrapper ); + $this->outputLogStream( $result ); if ( $this->buffer == WikiExporter::STREAM ) { $this->db->bufferResults( $prev ); } @@ -286,8 +285,8 @@ class WikiExporter { // Freeing result try { - if ( $wrapper ) { - $wrapper->free(); + if ( $result ) { + $result->free(); } } catch ( Exception $e2 ) { // Already in panic mode -> ignoring $e2 as $e has @@ -377,16 +376,15 @@ class WikiExporter { $prev = $this->db->bufferResults( false ); } - $wrapper = null; // Assuring $wrapper is not undefined, if exception occurs early + $result = null; // Assuring $result is not undefined, if exception occurs early try { wfRunHooks( 'ModifyExportQuery', array( $this->db, &$tables, &$cond, &$opts, &$join ) ); # Do the query! $result = $this->db->select( $tables, '*', $cond, __METHOD__, $opts, $join ); - $wrapper = $this->db->resultObject( $result ); # Output dump results - $this->outputPageStream( $wrapper ); + $this->outputPageStream( $result ); if ( $this->buffer == WikiExporter::STREAM ) { $this->db->bufferResults( $prev ); @@ -397,8 +395,8 @@ class WikiExporter { // Freeing result try { - if ( $wrapper ) { - $wrapper->free(); + if ( $result ) { + $result->free(); } } catch ( Exception $e2 ) { // Already in panic mode -> ignoring $e2 as $e has @@ -467,7 +465,7 @@ class WikiExporter { } /** - * @param array $resultset + * @param ResultWrapper $resultset */ protected function outputLogStream( $resultset ) { foreach ( $resultset as $row ) { @@ -532,6 +530,7 @@ class XmlDumpWriter { function siteInfo() { $info = array( $this->sitename(), + $this->dbname(), $this->homelink(), $this->generator(), $this->caseSetting(), @@ -549,6 +548,14 @@ class XmlDumpWriter { return Xml::element( 'sitename', array(), $wgSitename ); } + /** + * @return string + */ + function dbname() { + global $wgDBname; + return Xml::element( 'dbname', array(), $wgDBname ); + } + /** * @return string */ @@ -1361,10 +1368,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 @@ -1428,13 +1435,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