156 $this->reader =
new XMLReader();
157 $this->config = $config;
158 $this->hookRunner =
new HookRunner( $hookContainer );
159 $this->contentLanguage = $contentLanguage;
160 $this->namespaceInfo = $namespaceInfo;
161 $this->titleFactory = $titleFactory;
162 $this->wikiPageFactory = $wikiPageFactory;
163 $this->uploadRevisionImporter = $uploadRevisionImporter;
164 $this->permissionManager = $permissionManager;
165 $this->contentHandlerFactory = $contentHandlerFactory;
166 $this->slotRoleRegistry = $slotRoleRegistry;
168 if ( !in_array(
'uploadsource', stream_get_wrappers() ) ) {
169 stream_wrapper_register(
'uploadsource', UploadSourceAdapter::class );
176 $oldDisable = @libxml_disable_entity_loader(
false );
177 if ( defined(
'LIBXML_PARSEHUGE' ) ) {
178 $status = $this->reader->open(
"uploadsource://$id",
null, LIBXML_PARSEHUGE );
180 $status = $this->reader->open(
"uploadsource://$id" );
183 $error = libxml_get_last_error();
185 @libxml_disable_entity_loader( $oldDisable );
186 throw new MWException(
'Encountered an internal error while initializing WikiImporter object: ' .
190 @libxml_disable_entity_loader( $oldDisable );
200 $this->contentLanguage,
201 $this->namespaceInfo,
211 return $this->reader;
218 $this->
debug(
"FAILURE: $err" );
219 wfDebug(
"WikiImporter XML error: $err" );
226 if ( $this->mDebug ) {
234 public function warn( $data ) {
242 public function notice( $msg, ...$params ) {
243 if ( is_callable( $this->mNoticeCallback ) ) {
244 call_user_func( $this->mNoticeCallback, $msg, $params );
265 $this->mNoUpdates = $noupdates;
275 $this->pageOffset = $nthPage;
285 return wfSetVar( $this->mNoticeCallback, $callback );
294 $previous = $this->mPageCallback;
295 $this->mPageCallback = $callback;
309 $previous = $this->mPageOutCallback;
310 $this->mPageOutCallback = $callback;
320 $previous = $this->mRevisionCallback;
321 $this->mRevisionCallback = $callback;
331 $previous = $this->mUploadCallback;
332 $this->mUploadCallback = $callback;
342 $previous = $this->mLogItemCallback;
343 $this->mLogItemCallback = $callback;
353 $previous = $this->mSiteInfoCallback;
354 $this->mSiteInfoCallback = $callback;
364 $this->importTitleFactory = $factory;
373 if ( $namespace ===
null ) {
377 $this->contentLanguage,
378 $this->namespaceInfo,
385 $this->namespaceInfo->exists( intval( $namespace ) )
387 $namespace = intval( $namespace );
390 $this->namespaceInfo,
407 $status = Status::newGood();
408 $nsInfo = $this->namespaceInfo;
409 if ( $rootpage ===
null ) {
413 $this->contentLanguage,
418 } elseif ( $rootpage !==
'' ) {
419 $rootpage = rtrim( $rootpage,
'/' );
420 $title = Title::newFromText( $rootpage );
423 $status->fatal(
'import-rootpage-invalid' );
424 } elseif ( !$nsInfo->hasSubpages(
$title->getNamespace() ) ) {
427 : $this->contentLanguage->getNsText(
$title->getNamespace() );
428 $status->fatal(
'import-rootpage-nosubpage', $displayNSText );
448 $this->mImageBasePath = $dir;
455 $this->mImportUploads = $import;
464 $this->externalUserNames =
new ExternalUserNames( $usernamePrefix, $assignKnownUsers );
482 $title = $titleAndForeignTitle[0];
483 $page = $this->wikiPageFactory->newFromTitle(
$title );
484 $this->countableCache[
'title_' .
$title->getPrefixedText()] = $page->isCountable();
494 if ( !$revision->getContentHandler()->canBeUsedOn( $revision->getTitle() ) ) {
495 $this->
notice(
'import-error-bad-location',
496 $revision->getTitle()->getPrefixedText(),
498 $revision->getModel(),
499 $revision->getFormat()
506 return $revision->importOldRevision();
508 $this->
notice(
'import-error-unserialize',
509 $revision->getTitle()->getPrefixedText(),
511 $revision->getModel(),
512 $revision->getFormat()
525 return $revision->importLogItem();
534 $status = $this->uploadRevisionImporter->import( $revision );
535 return $status->isGood();
548 $sRevCount, $pageInfo
557 $page = $this->wikiPageFactory->newFromTitle( $pageIdentity );
559 $page->loadPageData(
'fromdbmaster' );
562 wfDebug( __METHOD__ .
': Skipping article count adjustment for ' . $pageIdentity .
563 ' because WikiPage::getContent() returned null' );
566 $user = RequestContext::getMain()->getUser();
567 $editInfo = $page->prepareContentForEdit(
$content,
null, $user );
568 $countKey =
'title_' . CacheKeyHelper::getKeyForPage( $pageIdentity );
569 $countable = $page->isCountable( $editInfo );
570 if ( array_key_exists( $countKey, $this->countableCache ) &&
571 $countable != $this->countableCache[$countKey] ) {
572 DeferredUpdates::addUpdate( SiteStatsUpdate::factory( [
573 'articles' => ( (
int)$countable - (
int)$this->countableCache[$countKey] )
579 $title = Title::castFromPageIdentity( $pageIdentity );
580 return $this->hookRunner->onAfterImportPage(
$title, $foreignTitle,
581 $revCount, $sRevCount, $pageInfo );
590 if ( isset( $this->mSiteInfoCallback ) ) {
591 return call_user_func_array(
592 $this->mSiteInfoCallback,
605 if ( isset( $this->mPageCallback ) ) {
606 call_user_func( $this->mPageCallback,
$title );
619 $sucCount, $pageInfo ) {
620 if ( isset( $this->mPageOutCallback ) ) {
621 call_user_func_array( $this->mPageOutCallback, func_get_args() );
631 if ( isset( $this->mRevisionCallback ) ) {
632 return call_user_func_array(
633 $this->mRevisionCallback,
647 if ( isset( $this->mLogItemCallback ) ) {
648 return call_user_func_array(
649 $this->mLogItemCallback,
664 return $this->reader->getAttribute( $attr );
675 if ( $this->reader->isEmptyElement ) {
679 while ( $this->reader->read() ) {
680 switch ( $this->reader->nodeType ) {
681 case XMLReader::TEXT:
682 case XMLReader::CDATA:
683 case XMLReader::SIGNIFICANT_WHITESPACE:
684 $buffer .= $this->reader->value;
686 case XMLReader::END_ELEMENT:
691 $this->reader->close();
706 $oldDisable = @libxml_disable_entity_loader(
true );
708 $this->reader->read();
710 if ( $this->reader->localName !=
'mediawiki' ) {
712 @libxml_disable_entity_loader( $oldDisable );
713 throw new MWException(
"Expected <mediawiki> tag, got " .
714 $this->reader->localName );
716 $this->
debug(
"<mediawiki> tag is correct." );
718 $this->
debug(
"Starting primary dump processing loop." );
720 $keepReading = $this->reader->read();
723 while ( $keepReading ) {
724 $tag = $this->reader->localName;
725 if ( $this->pageOffset ) {
726 if ( $tag ===
'page' ) {
729 if ( $pageCount < $this->pageOffset ) {
730 $keepReading = $this->reader->next();
734 $type = $this->reader->nodeType;
736 if ( !$this->hookRunner->onImportHandleToplevelXMLTag( $this ) ) {
738 } elseif ( $tag ==
'mediawiki' &&
$type == XMLReader::END_ELEMENT ) {
740 } elseif ( $tag ==
'siteinfo' ) {
742 } elseif ( $tag ==
'page' ) {
744 } elseif ( $tag ==
'logitem' ) {
746 } elseif ( $tag !=
'#text' ) {
747 $this->
warn(
"Unhandled top-level XML tag $tag" );
753 $keepReading = $this->reader->next();
755 $this->
debug(
"Skip" );
757 $keepReading = $this->reader->read();
762 @libxml_disable_entity_loader( $oldDisable );
763 $this->reader->close();
770 $this->
debug(
"Enter site info handler." );
774 $normalFields = [
'sitename',
'base',
'generator',
'case' ];
776 while ( $this->reader->read() ) {
777 if ( $this->reader->nodeType == XMLReader::END_ELEMENT &&
778 $this->reader->localName ==
'siteinfo' ) {
782 $tag = $this->reader->localName;
784 if ( $tag ==
'namespace' ) {
787 } elseif ( in_array( $tag, $normalFields ) ) {
792 $siteInfo[
'_namespaces'] = $this->foreignNamespaces;
797 $this->
debug(
"Enter log item handler." );
801 $normalFields = [
'id',
'comment',
'type',
'action',
'timestamp',
802 'logtitle',
'params' ];
804 while ( $this->reader->read() ) {
805 if ( $this->reader->nodeType == XMLReader::END_ELEMENT &&
806 $this->reader->localName ==
'logitem' ) {
810 $tag = $this->reader->localName;
812 if ( !$this->hookRunner->onImportHandleLogItemXMLTag( $this, $logInfo ) ) {
814 } elseif ( in_array( $tag, $normalFields ) ) {
816 } elseif ( $tag ==
'contributor' ) {
818 } elseif ( $tag !=
'#text' ) {
819 $this->
warn(
"Unhandled log-item XML tag $tag" );
833 if ( isset( $logInfo[
'id'] ) ) {
834 $revision->setID( $logInfo[
'id'] );
836 $revision->setType( $logInfo[
'type'] );
837 $revision->setAction( $logInfo[
'action'] );
838 if ( isset( $logInfo[
'timestamp'] ) ) {
839 $revision->setTimestamp( $logInfo[
'timestamp'] );
841 if ( isset( $logInfo[
'params'] ) ) {
842 $revision->setParams( $logInfo[
'params'] );
844 if ( isset( $logInfo[
'logtitle'] ) ) {
847 $revision->setTitle( Title::newFromText( $logInfo[
'logtitle'] ) );
850 $revision->setNoUpdates( $this->mNoUpdates );
852 if ( isset( $logInfo[
'comment'] ) ) {
853 $revision->setComment( $logInfo[
'comment'] );
856 if ( isset( $logInfo[
'contributor'][
'ip'] ) ) {
857 $revision->setUserIP( $logInfo[
'contributor'][
'ip'] );
860 if ( !isset( $logInfo[
'contributor'][
'username'] ) ) {
861 $revision->setUsername( $this->externalUserNames->addPrefix(
'Unknown user' ) );
863 $revision->setUsername(
864 $this->externalUserNames->applyPrefix( $logInfo[
'contributor'][
'username'] )
873 $this->
debug(
"Enter page handler." );
874 $pageInfo = [
'revisionCount' => 0,
'successfulRevisionCount' => 0 ];
877 $normalFields = [
'title',
'ns',
'id',
'redirect',
'restrictions' ];
882 while ( $skip ? $this->reader->next() : $this->reader->read() ) {
883 if ( $this->reader->nodeType == XMLReader::END_ELEMENT &&
884 $this->reader->localName ==
'page' ) {
890 $tag = $this->reader->localName;
895 } elseif ( !$this->hookRunner->onImportHandlePageXMLTag( $this, $pageInfo ) ) {
897 } elseif ( in_array( $tag, $normalFields ) ) {
905 if ( $tag ==
'redirect' ) {
910 } elseif ( $tag ==
'revision' || $tag ==
'upload' ) {
913 $pageInfo[
'ns'] ??
null );
916 if ( is_array(
$title ) ) {
918 list( $pageInfo[
'_title'], $foreignTitle ) =
$title;
926 if ( $tag ==
'revision' ) {
932 } elseif ( $tag !=
'#text' ) {
933 $this->
warn(
"Unhandled page XML tag $tag" );
943 if ( array_key_exists(
'_title', $pageInfo ) ) {
945 $title = $pageInfo[
'_title'];
949 $pageInfo[
'revisionCount'],
950 $pageInfo[
'successfulRevisionCount'],
960 $this->
debug(
"Enter revision handler" );
963 $normalFields = [
'id',
'parentid',
'timestamp',
'comment',
'minor',
'origin',
964 'model',
'format',
'text',
'sha1' ];
968 while ( $skip ? $this->reader->next() : $this->reader->read() ) {
969 if ( $this->reader->nodeType == XMLReader::END_ELEMENT &&
970 $this->reader->localName ==
'revision' ) {
974 $tag = $this->reader->localName;
976 if ( !$this->hookRunner->onImportHandleRevisionXMLTag(
977 $this, $pageInfo, $revisionInfo )
980 } elseif ( in_array( $tag, $normalFields ) ) {
982 } elseif ( $tag ==
'content' ) {
985 } elseif ( $tag ==
'contributor' ) {
987 } elseif ( $tag !=
'#text' ) {
988 $this->
warn(
"Unhandled revision XML tag $tag" );
993 $pageInfo[
'revisionCount']++;
995 $pageInfo[
'successfulRevisionCount']++;
1000 $this->
debug(
"Enter content handler" );
1003 $normalFields = [
'role',
'origin',
'model',
'format',
'text' ];
1007 while ( $skip ? $this->reader->next() : $this->reader->read() ) {
1008 if ( $this->reader->nodeType == XMLReader::END_ELEMENT &&
1009 $this->reader->localName ==
'content' ) {
1013 $tag = $this->reader->localName;
1015 if ( !$this->hookRunner->onImportHandleContentXMLTag(
1016 $this, $contentInfo )
1019 } elseif ( in_array( $tag, $normalFields ) ) {
1021 } elseif ( $tag !=
'#text' ) {
1022 $this->
warn(
"Unhandled content XML tag $tag" );
1027 return $contentInfo;
1041 if ( !isset( $contentInfo[
'text'] ) ) {
1042 throw new MWException(
'Missing text field in import.' );
1049 if ( ( !isset( $contentInfo[
'model'] ) ||
1050 in_array( $contentInfo[
'model'], [
1062 "the revision with ID $revisionId" :
1064 ) .
" exceeds the maximum allowable size ($wgMaxArticleSize KiB)" );
1067 $role = $contentInfo[
'role'] ?? SlotRecord::MAIN;
1071 $text = $handler->importTransform( $contentInfo[
'text'] );
1073 return $handler->unserializeContent( $text );
1085 $revId = $revisionInfo[
'id'] ?? 0;
1087 $revision->setID( $revisionInfo[
'id'] );
1090 $title = $pageInfo[
'_title'];
1091 $revision->setTitle(
$title );
1094 $revision->setContent( SlotRecord::MAIN,
$content );
1096 foreach ( $revisionInfo[
'content'] ?? [] as $slotInfo ) {
1097 if ( !isset( $slotInfo[
'role'] ) ) {
1098 throw new MWException(
"Missing role for imported slot." );
1102 $revision->setContent( $slotInfo[
'role'],
$content );
1104 $revision->setTimestamp( $revisionInfo[
'timestamp'] ??
wfTimestampNow() );
1106 if ( isset( $revisionInfo[
'comment'] ) ) {
1107 $revision->setComment( $revisionInfo[
'comment'] );
1110 if ( isset( $revisionInfo[
'minor'] ) ) {
1111 $revision->setMinor(
true );
1113 if ( isset( $revisionInfo[
'contributor'][
'ip'] ) ) {
1114 $revision->setUserIP( $revisionInfo[
'contributor'][
'ip'] );
1115 } elseif ( isset( $revisionInfo[
'contributor'][
'username'] ) ) {
1116 $revision->setUsername(
1117 $this->externalUserNames->applyPrefix( $revisionInfo[
'contributor'][
'username'] )
1120 $revision->setUsername( $this->externalUserNames->addPrefix(
'Unknown user' ) );
1122 if ( isset( $revisionInfo[
'sha1'] ) ) {
1123 $revision->setSha1Base36( $revisionInfo[
'sha1'] );
1125 $revision->setNoUpdates( $this->mNoUpdates );
1135 $this->
debug(
"Enter upload handler" );
1138 $normalFields = [
'timestamp',
'comment',
'filename',
'text',
1139 'src',
'size',
'sha1base36',
'archivename',
'rel' ];
1143 while ( $skip ? $this->reader->next() : $this->reader->read() ) {
1144 if ( $this->reader->nodeType == XMLReader::END_ELEMENT &&
1145 $this->reader->localName ==
'upload' ) {
1149 $tag = $this->reader->localName;
1151 if ( !$this->hookRunner->onImportHandleUploadXMLTag( $this, $pageInfo ) ) {
1153 } elseif ( in_array( $tag, $normalFields ) ) {
1155 } elseif ( $tag ==
'contributor' ) {
1157 } elseif ( $tag ==
'contents' ) {
1159 $encoding = $this->reader->getAttribute(
'encoding' );
1160 if ( $encoding ===
'base64' ) {
1161 $uploadInfo[
'fileSrc'] = $this->
dumpTemp( base64_decode( $contents ) );
1162 $uploadInfo[
'isTempSrc'] =
true;
1164 } elseif ( $tag !=
'#text' ) {
1165 $this->
warn(
"Unhandled upload XML tag $tag" );
1170 if ( $this->mImageBasePath && isset( $uploadInfo[
'rel'] ) ) {
1171 $path =
"{$this->mImageBasePath}/{$uploadInfo['rel']}";
1172 if ( file_exists(
$path ) ) {
1173 $uploadInfo[
'fileSrc'] =
$path;
1174 $uploadInfo[
'isTempSrc'] =
false;
1178 if ( $this->mImportUploads ) {
1188 $filename = tempnam(
wfTempDir(),
'importupload' );
1189 file_put_contents( $filename, $contents );
1200 $revId = $pageInfo[
'id'];
1201 $title = $pageInfo[
'_title'];
1204 $revision->setTitle(
$title );
1205 $revision->setID( $revId );
1206 $revision->setTimestamp( $uploadInfo[
'timestamp'] );
1207 $revision->setContent( SlotRecord::MAIN,
$content );
1208 $revision->setFilename( $uploadInfo[
'filename'] );
1209 if ( isset( $uploadInfo[
'archivename'] ) ) {
1210 $revision->setArchiveName( $uploadInfo[
'archivename'] );
1212 $revision->setSrc( $uploadInfo[
'src'] );
1213 if ( isset( $uploadInfo[
'fileSrc'] ) ) {
1214 $revision->setFileSrc( $uploadInfo[
'fileSrc'],
1215 !empty( $uploadInfo[
'isTempSrc'] )
1218 if ( isset( $uploadInfo[
'sha1base36'] ) ) {
1219 $revision->setSha1Base36( $uploadInfo[
'sha1base36'] );
1221 $revision->setSize( intval( $uploadInfo[
'size'] ) );
1222 $revision->setComment( $uploadInfo[
'comment'] );
1224 if ( isset( $uploadInfo[
'contributor'][
'ip'] ) ) {
1225 $revision->setUserIP( $uploadInfo[
'contributor'][
'ip'] );
1227 if ( isset( $uploadInfo[
'contributor'][
'username'] ) ) {
1228 $revision->setUsername(
1229 $this->externalUserNames->applyPrefix( $uploadInfo[
'contributor'][
'username'] )
1232 $revision->setNoUpdates( $this->mNoUpdates );
1234 return call_user_func( $this->mUploadCallback, $revision );
1241 $this->
debug(
"Enter contributor handler." );
1243 if ( $this->reader->isEmptyElement ) {
1247 $fields = [
'id',
'ip',
'username' ];
1250 while ( $this->reader->read() ) {
1251 if ( $this->reader->nodeType == XMLReader::END_ELEMENT &&
1252 $this->reader->localName ==
'contributor' ) {
1256 $tag = $this->reader->localName;
1258 if ( in_array( $tag, $fields ) ) {
1272 if ( $this->foreignNamespaces ===
null ) {
1274 $this->contentLanguage
1278 $this->foreignNamespaces );
1281 $foreignTitle = $foreignTitleFactory->createForeignTitle( $text,
1284 $title = $this->importTitleFactory->createTitleFromForeignTitle(
1287 $commandLineMode = $this->config->get(
'CommandLineMode' );
1289 # Invalid page title? Ignore the page
1290 $this->
notice(
'import-error-invalid', $foreignTitle->getFullText() );
1292 } elseif (
$title->isExternal() ) {
1293 $this->
notice(
'import-error-interwiki',
$title->getPrefixedText() );
1295 } elseif ( !
$title->canExist() ) {
1296 $this->
notice(
'import-error-special',
$title->getPrefixedText() );
1298 } elseif ( !$commandLineMode ) {
1299 $user = RequestContext::getMain()->getUser();
1301 if ( !$this->permissionManager->userCan(
'edit', $user,
$title ) ) {
1302 # Do not import if the importing wiki user cannot edit this page
1303 $this->
notice(
'import-error-edit',
$title->getPrefixedText() );
1309 return [
$title, $foreignTitle ];
1317 return $this->contentHandlerFactory->getContentHandler( $model );
1327 return $this->slotRoleRegistry
1328 ->getRoleHandler( $role )
1329 ->getDefaultModel(
$title );
$wgMaxArticleSize
Maximum article size in kibibytes.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfTempDir()
Tries to get the system directory for temporary files.
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
wfSetVar(&$dest, $source, $force=false)
Sets dest to source and returns the original value of dest If source is NULL, it just returns the val...
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Class to parse and build external user names.
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
Exception representing a failure to serialize or unserialize a content object.
A parser that translates page titles on a foreign wiki into ForeignTitle objects, with no knowledge o...
A class to convert page titles on a foreign wiki (ForeignTitle objects) into page titles on the local...
A parser that translates page titles on a foreign wiki into ForeignTitle objects, using information a...
A class to convert page titles on a foreign wiki (ForeignTitle objects) into page titles on the local...
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
A class to convert page titles on a foreign wiki (ForeignTitle objects) into page titles on the local...
Represents a title within MediaWiki.
static registerSource(ImportSource $source)
XML file reader for the page data importer.
callable $mLogItemCallback
setImportUploads( $import)
doImport()
Primary entry point.
setPageCallback( $callback)
Sets the action to perform as each new page in the stream is reached.
setUsernamePrefix( $usernamePrefix, $assignKnownUsers)
ExternalUserNames $externalUserNames
setNoUpdates( $noupdates)
Set 'no updates' mode.
setLogItemCallback( $callback)
Sets the action to perform as each log item reached.
pageOutCallback(PageIdentity $pageIdentity, $foreignTitle, $revCount, $sucCount, $pageInfo)
Notify the callback function when a "</page>" is closed.
callable $mUploadCallback
PermissionManager $permissionManager
array null $foreignNamespaces
importUpload( $revision)
Dummy for now...
setImportTitleFactory( $factory)
Sets the factory object to use to convert ForeignTitle objects into local Title objects.
callable $mPageOutCallback
setSiteInfoCallback( $callback)
Sets the action to perform when site info is encountered.
getContentHandler( $model)
callable null $mNoticeCallback
nodeAttribute( $attr)
Retrieves the contents of the named attribute of the current element.
pageCallback( $title)
Notify the callback function when a new "<page>" is reached.
processLogItem( $logInfo)
TitleFactory $titleFactory
setTargetNamespace( $namespace)
Set a target namespace to override the defaults.
UploadRevisionImporter $uploadRevisionImporter
setPageOffset( $nthPage)
Sets 'pageOffset' value.
string null $mImageBasePath
nodeContents()
Shouldn't something like this be built-in to XMLReader? Fetches text contents of the current element,...
WikiPageFactory $wikiPageFactory
importLogItem( $revision)
Default per-revision callback, performs the import.
NamespaceInfo $namespaceInfo
getDefaultContentModel( $title, $role)
handleRevision(&$pageInfo)
revisionCallback( $revision)
Notify the callback function of a revision.
logItemCallback( $revision)
Notify the callback function of a new log item.
Language $contentLanguage
setDebug( $debug)
Set debug mode...
bool null $mImportUploads
__construct(ImportSource $source, Config $config, HookContainer $hookContainer, Language $contentLanguage, NamespaceInfo $namespaceInfo, TitleFactory $titleFactory, WikiPageFactory $wikiPageFactory, UploadRevisionImporter $uploadRevisionImporter, PermissionManager $permissionManager, IContentHandlerFactory $contentHandlerFactory, SlotRoleRegistry $slotRoleRegistry)
Creates an ImportXMLReader drawing from the source provided.
IContentHandlerFactory $contentHandlerFactory
processRevision( $pageInfo, $revisionInfo)
processUpload( $pageInfo, $uploadInfo)
callable null $mSiteInfoCallback
bool $disableStatisticsUpdate
processTitle( $text, $ns=null)
makeContent(Title $title, $revisionId, $contentInfo)
notice( $msg,... $params)
importRevision( $revision)
Default per-revision callback, performs the import.
ImportTitleFactory $importTitleFactory
setPageOutCallback( $callback)
Sets the action to perform as each page in the stream is completed.
setTargetRootPage( $rootpage)
Set a target root page under which all pages are imported.
setNoticeCallback( $callback)
Set a callback that displays notice messages.
finishImportPage(PageIdentity $pageIdentity, $foreignTitle, $revCount, $sRevCount, $pageInfo)
Mostly for hook use.
beforeImportPage( $titleAndForeignTitle)
Default per-page callback.
callable $mRevisionCallback
disableStatisticsUpdate()
Statistics update can cause a lot of time.
siteInfoCallback( $siteInfo)
Notify the callback function of site info.
setRevisionCallback( $callback)
Sets the action to perform as each page revision is reached.
setUploadCallback( $callback)
Sets the action to perform as each file upload version is reached.
SlotRoleRegistry $slotRoleRegistry
Represents a revision, log entry or upload during the import process.
Interface for configuration instances.
Source interface for XML import.
Represents an object that can convert page titles on a foreign wiki (ForeignTitle objects) into page ...
Interface for objects (potentially) representing an editable wiki page.