* @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() ) ) {
$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;
} else {
$revision->setUsername( 'Unknown user' );
}
+ if ( isset( $revisionInfo['sha1'] ) ) {
+ $revision->setSha1Base36( $revisionInfo['sha1'] );
+ }
$revision->setNoUpdates( $this->mNoUpdates );
return $this->revisionCallback( $revision );