X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fimport%2FWikiImporter.php;h=90660797f108f8cf68a2458b196daca0793acb82;hb=be08b7aa186d15c341c8e59d49d6b80a11369c87;hp=63258cbcba7a3a504ade1a7fa6522bedc3a99753;hpb=b5cddfb27b0d50bd396b1ff92d022b2dec766754;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/import/WikiImporter.php b/includes/import/WikiImporter.php index 63258cbcba..90660797f1 100644 --- a/includes/import/WikiImporter.php +++ b/includes/import/WikiImporter.php @@ -55,16 +55,12 @@ class WikiImporter { * @param Config $config * @throws Exception */ - function __construct( ImportSource $source, Config $config = null ) { + function __construct( ImportSource $source, Config $config ) { if ( !class_exists( 'XMLReader' ) ) { throw new Exception( 'Import requires PHP to have been compiled with libxml support' ); } $this->reader = new XMLReader(); - if ( !$config ) { - wfDeprecated( __METHOD__ . ' without a Config instance', '1.25' ); - $config = MediaWikiServices::getInstance()->getMainConfig(); - } $this->config = $config; if ( !in_array( 'uploadsource', stream_get_wrappers() ) ) { @@ -428,7 +424,7 @@ class WikiImporter { /** * Alternate per-revision callback, for debugging. - * @param WikiRevision $revision + * @param WikiRevision &$revision */ public function debugRevisionHandler( &$revision ) { $this->debug( "Got revision:" ); @@ -817,7 +813,7 @@ class WikiImporter { $this->debug( "Enter revision handler" ); $revisionInfo = []; - $normalFields = [ 'id', 'timestamp', 'comment', 'minor', 'model', 'format', 'text' ]; + $normalFields = [ 'id', 'timestamp', 'comment', 'minor', 'model', 'format', 'text', 'sha1' ]; $skip = false; @@ -920,6 +916,9 @@ class WikiImporter { } else { $revision->setUsername( 'Unknown user' ); } + if ( isset( $revisionInfo['sha1'] ) ) { + $revision->setSha1Base36( $revisionInfo['sha1'] ); + } $revision->setNoUpdates( $this->mNoUpdates ); return $this->revisionCallback( $revision );