X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FExport.php;h=98de4c001b6f5536de3ee4c7cd01db3259890054;hb=876bddf6376fe75952735ee3f231f557c2da48d0;hp=996c14bd1c71ccbd1fc9292f75f10a7180bbfb71;hpb=978bb31c5ec29c3e4788ea83735c88dd66e98844;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Export.php b/includes/Export.php index 996c14bd1c..98de4c001b 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -249,9 +249,13 @@ class WikiExporter { $where = array( 'user_id = log_user' ); # Hide private logs $hideLogs = LogEventsList::getExcludeClause( $this->db ); - if ( $hideLogs ) $where[] = $hideLogs; + if ( $hideLogs ) { + $where[] = $hideLogs; + } # Add on any caller specified conditions - if ( $cond ) $where[] = $cond; + if ( $cond ) { + $where[] = $cond; + } # Get logging table name for logging.* clause $logging = $this->db->tableName( 'logging' ); @@ -595,7 +599,7 @@ class XmlDumpWriter { $out = " \n"; $title = Title::makeTitle( $row->page_namespace, $row->page_title ); $out .= ' ' . Xml::elementClean( 'title', array(), self::canonicalTitle( $title ) ) . "\n"; - $out .= ' ' . Xml::element( 'ns', array(), strval( $row->page_namespace) ) . "\n"; + $out .= ' ' . Xml::element( 'ns', array(), strval( $row->page_namespace ) ) . "\n"; $out .= ' ' . Xml::element( 'id', array(), strval( $row->page_id ) ) . "\n"; if ( $row->page_is_redirect ) { $page = WikiPage::factory( $title ); @@ -638,7 +642,7 @@ class XmlDumpWriter { $out = " \n"; $out .= " " . Xml::element( 'id', null, strval( $row->rev_id ) ) . "\n"; - if( isset( $row->rev_parent_id ) && $row->rev_parent_id ) { + if ( isset( $row->rev_parent_id ) && $row->rev_parent_id ) { $out .= " " . Xml::element( 'parentid', null, strval( $row->rev_parent_id ) ) . "\n"; } @@ -685,7 +689,7 @@ class XmlDumpWriter { $content_model = strval( $row->rev_content_model ); } else { // probably using $wgContentHandlerUseDB = false; - // @todo: test! + // @todo test! $title = Title::makeTitle( $row->page_namespace, $row->page_title ); $content_model = ContentHandler::getDefaultModelFor( $title ); } @@ -696,7 +700,7 @@ class XmlDumpWriter { $content_format = strval( $row->rev_content_format ); } else { // probably using $wgContentHandlerUseDB = false; - // @todo: test! + // @todo test! $content_handler = ContentHandler::getForModelID( $content_model ); $content_format = $content_handler->getDefaultFormat(); } @@ -820,10 +824,13 @@ class XmlDumpWriter { $archiveName = ''; } if ( $dumpContents ) { + $be = $file->getRepo()->getBackend(); # Dump file as base64 # Uses only XML-safe characters, so does not need escaping + # @TODO: too bad this loads the contents into memory (script might swap) $contents = ' ' . - chunk_split( base64_encode( file_get_contents( $file->getPath() ) ) ) . + chunk_split( base64_encode( + $be->getFileContents( array( 'src' => $file->getPath() ) ) ) ) . " \n"; } else { $contents = ''; @@ -1187,7 +1194,7 @@ class Dump7ZipOutput extends DumpPipeOutput { // Suppress annoying useless crap from p7zip // Unfortunately this could suppress real error messages too $command .= ' >' . wfGetNull() . ' 2>&1'; - return( $command ); + return $command; } /**