libxml >= 2.7.3 ha a 10mb cap on the size of a text node and the LIBXML_PARSEHUGE...
authorAriel Glenn <ariel@users.mediawiki.org>
Tue, 12 Jul 2011 15:01:58 +0000 (15:01 +0000)
committerAriel Glenn <ariel@users.mediawiki.org>
Tue, 12 Jul 2011 15:01:58 +0000 (15:01 +0000)
includes/Import.php
maintenance/backupPrefetch.inc

index 2a86438..e1fde33 100644 (file)
@@ -45,7 +45,12 @@ class WikiImporter {
 
                stream_wrapper_register( 'uploadsource', 'UploadSourceAdapter' );
                $id = UploadSourceAdapter::registerSource( $source );
-               $this->reader->open( "uploadsource://$id" );
+               if (defined( 'LIBXML_PARSEHUGE' ) ) {
+                       $this->reader->open( "uploadsource://$id", null, LIBXML_PARSEHUGE );
+               }
+               else {
+                       $this->reader->open( "uploadsource://$id" );
+               }
 
                // Default callbacks
                $this->setRevisionCallback( array( $this, "importRevision" ) );
index d3c4e79..93f75c6 100644 (file)
@@ -51,7 +51,12 @@ class BaseDump {
                $this->infiles = explode(';',$infile);
                $this->reader = new XMLReader();
                $infile = array_shift($this->infiles);
-               $this->reader->open( $infile );
+               if (defined( 'LIBXML_PARSEHUGE' ) ) {
+                       $this->reader->open( $infile, null, LIBXML_PARSEHUGE );
+               }
+               else {
+                       $this->reader->open( $infile );
+               }
        }
 
        /**