MediaWiki REL1_40
|
XML file reader for the page data importer. More...
Public Member Functions | |
__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. | |
beforeImportPage ( $titleAndForeignTitle) | |
Default per-page callback. | |
debug ( $data) | |
disableStatisticsUpdate () | |
Statistics update can cause a lot of time. | |
doImport () | |
Primary entry point. | |
finishImportPage (PageIdentity $pageIdentity, $foreignTitle, $revCount, $sRevCount, $pageInfo) | |
Mostly for hook use. | |
getReader () | |
importLogItem ( $revision) | |
Default per-revision callback, performs the import. | |
importRevision ( $revision) | |
Default per-revision callback, performs the import. | |
importUpload ( $revision) | |
Dummy for now... | |
nodeAttribute ( $attr) | |
Retrieves the contents of the named attribute of the current element. | |
nodeContents () | |
Shouldn't something like this be built-in to XMLReader? Fetches text contents of the current element, assuming no sub-elements or such scary things. | |
notice ( $msg,... $params) | |
pageCallback ( $title) | |
Notify the callback function when a new "<page>" is reached. | |
setDebug ( $debug) | |
Set debug mode... | |
setImageBasePath ( $dir) | |
setImportTitleFactory ( $factory) | |
Sets the factory object to use to convert ForeignTitle objects into local Title objects. | |
setImportUploads ( $import) | |
setLogItemCallback ( $callback) | |
Sets the action to perform as each log item reached. | |
setNoticeCallback ( $callback) | |
Set a callback that displays notice messages. | |
setNoUpdates ( $noupdates) | |
Set 'no updates' mode. | |
setPageCallback ( $callback) | |
Sets the action to perform as each new page in the stream is reached. | |
setPageOffset ( $nthPage) | |
Sets 'pageOffset' value. | |
setPageOutCallback ( $callback) | |
Sets the action to perform as each page in the stream is completed. | |
setRevisionCallback ( $callback) | |
Sets the action to perform as each page revision is reached. | |
setSiteInfoCallback ( $callback) | |
Sets the action to perform when site info is encountered. | |
setTargetNamespace ( $namespace) | |
Set a target namespace to override the defaults. | |
setTargetRootPage ( $rootpage) | |
Set a target root page under which all pages are imported. | |
setUploadCallback ( $callback) | |
Sets the action to perform as each file upload version is reached. | |
setUsernamePrefix ( $usernamePrefix, $assignKnownUsers) | |
throwXmlError ( $err) | |
warn ( $data) | |
XML file reader for the page data importer.
implements Special:Import
Definition at line 49 of file WikiImporter.php.
WikiImporter::__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.
ImportSource | $source | |
Config | $config | |
HookContainer | $hookContainer | |
Language | $contentLanguage | |
NamespaceInfo | $namespaceInfo | |
TitleFactory | $titleFactory | |
WikiPageFactory | $wikiPageFactory | |
UploadRevisionImporter | $uploadRevisionImporter | |
PermissionManager | $permissionManager | |
IContentHandlerFactory | $contentHandlerFactory | |
SlotRoleRegistry | $slotRoleRegistry |
MWException |
Definition at line 152 of file WikiImporter.php.
References $source, UploadSourceAdapter\registerSource(), setLogItemCallback(), setPageCallback(), setPageOutCallback(), setRevisionCallback(), and setUploadCallback().
WikiImporter::beforeImportPage | ( | $titleAndForeignTitle | ) |
Default per-page callback.
Sets up some things related to site statistics
array | $titleAndForeignTitle | Two-element array, with Title object at index 0 and ForeignTitle object at index 1 |
Definition at line 472 of file WikiImporter.php.
References $title.
WikiImporter::debug | ( | $data | ) |
string | $data |
Definition at line 216 of file WikiImporter.php.
References wfDebug().
Referenced by doImport(), and throwXmlError().
WikiImporter::disableStatisticsUpdate | ( | ) |
Statistics update can cause a lot of time.
Definition at line 462 of file WikiImporter.php.
References disableStatisticsUpdate().
Referenced by disableStatisticsUpdate(), and finishImportPage().
WikiImporter::doImport | ( | ) |
Primary entry point.
Exception | |
MWException |
Definition at line 693 of file WikiImporter.php.
WikiImporter::finishImportPage | ( | PageIdentity | $pageIdentity, |
$foreignTitle, | |||
$revCount, | |||
$sRevCount, | |||
$pageInfo ) |
Mostly for hook use.
PageIdentity | $pageIdentity | |
ForeignTitle | $foreignTitle | |
int | $revCount | |
int | $sRevCount | |
array | $pageInfo |
Definition at line 538 of file WikiImporter.php.
References $title, disableStatisticsUpdate(), and wfDebug().
WikiImporter::getReader | ( | ) |
Definition at line 201 of file WikiImporter.php.
WikiImporter::importLogItem | ( | $revision | ) |
Default per-revision callback, performs the import.
WikiRevision | $revision |
Definition at line 515 of file WikiImporter.php.
WikiImporter::importRevision | ( | $revision | ) |
Default per-revision callback, performs the import.
WikiRevision | $revision |
Definition at line 484 of file WikiImporter.php.
References notice().
WikiImporter::importUpload | ( | $revision | ) |
Dummy for now...
WikiRevision | $revision |
Definition at line 524 of file WikiImporter.php.
WikiImporter::nodeAttribute | ( | $attr | ) |
Retrieves the contents of the named attribute of the current element.
string | $attr | The name of the attribute |
Definition at line 655 of file WikiImporter.php.
WikiImporter::nodeContents | ( | ) |
Shouldn't something like this be built-in to XMLReader? Fetches text contents of the current element, assuming no sub-elements or such scary things.
Definition at line 666 of file WikiImporter.php.
WikiImporter::notice | ( | $msg, | |
$params ) |
string | $msg | |
mixed | ...$params |
Definition at line 233 of file WikiImporter.php.
References wfDebug(), and wfMessage().
Referenced by importRevision().
WikiImporter::pageCallback | ( | $title | ) |
Notify the callback function when a new "<page>" is reached.
array | $title |
Definition at line 596 of file WikiImporter.php.
References $title.
WikiImporter::setDebug | ( | $debug | ) |
WikiImporter::setImageBasePath | ( | $dir | ) |
string | $dir |
Definition at line 438 of file WikiImporter.php.
WikiImporter::setImportTitleFactory | ( | $factory | ) |
Sets the factory object to use to convert ForeignTitle objects into local Title objects.
ImportTitleFactory | $factory |
Definition at line 354 of file WikiImporter.php.
Referenced by setTargetNamespace(), and setTargetRootPage().
WikiImporter::setImportUploads | ( | $import | ) |
bool | $import |
Definition at line 445 of file WikiImporter.php.
WikiImporter::setLogItemCallback | ( | $callback | ) |
Sets the action to perform as each log item reached.
callable | $callback |
Definition at line 332 of file WikiImporter.php.
Referenced by __construct().
WikiImporter::setNoticeCallback | ( | $callback | ) |
Set a callback that displays notice messages.
callable | $callback |
Definition at line 275 of file WikiImporter.php.
References wfSetVar().
WikiImporter::setNoUpdates | ( | $noupdates | ) |
Set 'no updates' mode.
In this mode, the link tables will not be updated by the importer
bool | $noupdates |
Definition at line 255 of file WikiImporter.php.
WikiImporter::setPageCallback | ( | $callback | ) |
Sets the action to perform as each new page in the stream is reached.
callable | null | $callback |
Definition at line 284 of file WikiImporter.php.
Referenced by __construct().
WikiImporter::setPageOffset | ( | $nthPage | ) |
Sets 'pageOffset' value.
So it will skip the first n-1 pages and start from the nth page. It's 1-based indexing.
int | $nthPage |
Definition at line 265 of file WikiImporter.php.
WikiImporter::setPageOutCallback | ( | $callback | ) |
Sets the action to perform as each page in the stream is completed.
Callback accepts the page title (as a Title object), a second object with the original title form (in case it's been overridden into a local namespace), and a count of revisions.
callable | null | $callback |
Definition at line 299 of file WikiImporter.php.
Referenced by __construct().
WikiImporter::setRevisionCallback | ( | $callback | ) |
Sets the action to perform as each page revision is reached.
callable | null | $callback |
Definition at line 310 of file WikiImporter.php.
Referenced by __construct().
WikiImporter::setSiteInfoCallback | ( | $callback | ) |
Sets the action to perform when site info is encountered.
callable | $callback |
Definition at line 343 of file WikiImporter.php.
WikiImporter::setTargetNamespace | ( | $namespace | ) |
Set a target namespace to override the defaults.
null | int | $namespace |
Definition at line 363 of file WikiImporter.php.
References setImportTitleFactory().
Referenced by setTargetRootPage().
WikiImporter::setTargetRootPage | ( | $rootpage | ) |
Set a target root page under which all pages are imported.
null | string | $rootpage |
Definition at line 397 of file WikiImporter.php.
References $title, NS_MAIN, setImportTitleFactory(), setTargetNamespace(), and wfMessage().
WikiImporter::setUploadCallback | ( | $callback | ) |
Sets the action to perform as each file upload version is reached.
callable | $callback |
Definition at line 321 of file WikiImporter.php.
Referenced by __construct().
WikiImporter::setUsernamePrefix | ( | $usernamePrefix, | |
$assignKnownUsers ) |
string | $usernamePrefix | Prefix to apply to unknown (and possibly also known) usernames |
bool | $assignKnownUsers | Whether to apply the prefix to usernames that exist locally |
Definition at line 454 of file WikiImporter.php.
WikiImporter::throwXmlError | ( | $err | ) |
string | $err |
Definition at line 208 of file WikiImporter.php.
WikiImporter::warn | ( | $data | ) |
string | $data |
Definition at line 225 of file WikiImporter.php.
References wfDebug().
Referenced by doImport().