From: Ariel Glenn Date: Tue, 12 Jul 2011 15:01:58 +0000 (+0000) Subject: libxml >= 2.7.3 ha a 10mb cap on the size of a text node and the LIBXML_PARSEHUGE... X-Git-Tag: 1.31.0-rc.0~28910 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=de1f9c7d61e792217305e26392cfe4d3a48b3207;p=lhc%2Fweb%2Fwiklou.git libxml >= 2.7.3 ha a 10mb cap on the size of a text node and the LIBXML_PARSEHUGE lets us override that, needed for lucid since there are a few revs in the db larger than that limit --- diff --git a/includes/Import.php b/includes/Import.php index 2a864382d5..e1fde33c24 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -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" ) ); diff --git a/maintenance/backupPrefetch.inc b/maintenance/backupPrefetch.inc index d3c4e790db..93f75c65d3 100644 --- a/maintenance/backupPrefetch.inc +++ b/maintenance/backupPrefetch.inc @@ -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 ); + } } /**