MediaWiki
1.23.0
|
XML file reader for the page data importer. More...
Public Member Functions | |
__construct ( $source) | |
Creates an ImportXMLReader drawing from the source provided. More... | |
debugRevisionHandler (&$revision) | |
Alternate per-revision callback, for debugging. More... | |
doImport () | |
Primary entry point. More... | |
finishImportPage ( $title, $origTitle, $revCount, $sRevCount, $pageInfo) | |
Mostly for hook use. More... | |
importLogItem ( $rev) | |
Default per-revision callback, performs the import. More... | |
importRevision ( $revision) | |
Default per-revision callback, performs the import. More... | |
importUpload ( $revision) | |
Dummy for now... More... | |
pageCallback ( $title) | |
Notify the callback function when a new "<page>" is reached. More... | |
setDebug ( $debug) | |
Set debug mode... More... | |
setImageBasePath ( $dir) | |
setImportUploads ( $import) | |
setLogItemCallback ( $callback) | |
Sets the action to perform as each log item reached. More... | |
setNoticeCallback ( $callback) | |
Set a callback that displays notice messages. More... | |
setNoUpdates ( $noupdates) | |
Set 'no updates' mode. More... | |
setPageCallback ( $callback) | |
Sets the action to perform as each new page in the stream is reached. More... | |
setPageOutCallback ( $callback) | |
Sets the action to perform as each page in the stream is completed. More... | |
setRevisionCallback ( $callback) | |
Sets the action to perform as each page revision is reached. More... | |
setSiteInfoCallback ( $callback) | |
Sets the action to perform when site info is encountered. More... | |
setTargetNamespace ( $namespace) | |
Set a target namespace to override the defaults. More... | |
setTargetRootPage ( $rootpage) | |
Set a target root page under which all pages are imported. More... | |
setUploadCallback ( $callback) | |
Sets the action to perform as each file upload version is reached. More... | |
Public Attributes | |
$mDebug | |
$mImageBasePath | |
$mPageCallback | |
$mPageOutCallback | |
$mRevisionCallback | |
$mTargetNamespace | |
$mTargetRootPage | |
$mUploadCallback | |
Private Member Functions | |
debug ( $data) | |
dumpElement () | |
Left in for debugging. More... | |
dumpTemp ( $contents) | |
handleContributor () | |
handleLogItem () | |
handlePage () | |
handleRevision (&$pageInfo) | |
handleSiteInfo () | |
handleUpload (&$pageInfo) | |
logItemCallback ( $revision) | |
Notify the callback function of a new log item. More... | |
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. More... | |
notice ( $msg) | |
pageOutCallback ( $title, $origTitle, $revCount, $sucCount, $pageInfo) | |
Notify the callback function when a "</page>" is closed. More... | |
processLogItem ( $logInfo) | |
processRevision ( $pageInfo, $revisionInfo) | |
processTitle ( $text) | |
processUpload ( $pageInfo, $uploadInfo) | |
revisionCallback ( $revision) | |
Notify the callback function of a revision. More... | |
throwXmlError ( $err) | |
warn ( $data) | |
Private Attributes | |
$mImportUploads | |
$mLogItemCallback | |
$mNoticeCallback | |
$mNoUpdates = false | |
$mSiteInfoCallback | |
$reader = null | |
XML file reader for the page data importer.
implements Special:Import
Definition at line 33 of file Import.php.
WikiImporter::__construct | ( | $source | ) |
Creates an ImportXMLReader drawing from the source provided.
$source |
Definition at line 45 of file Import.php.
References $source, array(), UploadSourceAdapter\registerSource(), setLogItemCallback(), setPageOutCallback(), setRevisionCallback(), and setUploadCallback().
|
private |
Definition at line 68 of file Import.php.
References wfDebug().
Referenced by debugRevisionHandler(), doImport(), handleLogItem(), handlePage(), handleRevision(), handleUpload(), and throwXmlError().
WikiImporter::debugRevisionHandler | ( | & | $revision | ) |
Alternate per-revision callback, for debugging.
$revision | WikiRevision |
Definition at line 317 of file Import.php.
References debug().
WikiImporter::doImport | ( | ) |
Primary entry point.
MWException |
Definition at line 455 of file Import.php.
References $type, array(), debug(), handleLogItem(), handlePage(), handleSiteInfo(), warn(), and wfRunHooks().
|
private |
Left in for debugging.
Definition at line 413 of file Import.php.
|
private |
$contents |
Definition at line 780 of file Import.php.
References wfTempDir().
Referenced by handleUpload().
WikiImporter::finishImportPage | ( | $title, | |
$origTitle, | |||
$revCount, | |||
$sRevCount, | |||
$pageInfo | |||
) |
Mostly for hook use.
$title | |
$origTitle | |
$revCount | |
$sRevCount | |
$pageInfo |
Definition at line 308 of file Import.php.
References $args, and wfRunHooks().
|
private |
Definition at line 828 of file Import.php.
References array(), and nodeContents().
Referenced by handleLogItem(), handleRevision(), and handleUpload().
|
private |
Definition at line 521 of file Import.php.
References array(), debug(), handleContributor(), nodeContents(), processLogItem(), warn(), and wfRunHooks().
Referenced by doImport().
|
private |
Definition at line 582 of file Import.php.
References $title, array(), debug(), handleRevision(), handleUpload(), list, nodeContents(), pageCallback(), pageOutCallback(), processTitle(), warn(), and wfRunHooks().
Referenced by doImport().
|
private |
$pageInfo | array |
Definition at line 639 of file Import.php.
References array(), debug(), handleContributor(), nodeContents(), processRevision(), warn(), and wfRunHooks().
Referenced by handlePage().
|
private |
MWException |
Definition at line 511 of file Import.php.
Referenced by doImport().
|
private |
$pageInfo |
Definition at line 725 of file Import.php.
References $path, array(), debug(), dumpTemp(), handleContributor(), nodeContents(), processUpload(), warn(), and wfRunHooks().
Referenced by handlePage().
WikiImporter::importLogItem | ( | $rev | ) |
Default per-revision callback, performs the import.
$rev | WikiRevision |
Definition at line 284 of file Import.php.
WikiImporter::importRevision | ( | $revision | ) |
Default per-revision callback, performs the import.
$revision | WikiRevision |
Definition at line 254 of file Import.php.
WikiImporter::importUpload | ( | $revision | ) |
|
private |
Notify the callback function of a new log item.
$revision | WikiRevision object |
Definition at line 374 of file Import.php.
References array().
Referenced by processLogItem().
|
private |
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 390 of file Import.php.
Referenced by handleContributor(), handleLogItem(), handlePage(), handleRevision(), and handleUpload().
|
private |
Definition at line 78 of file Import.php.
References $params, and wfMessage().
Referenced by importRevision(), and processTitle().
WikiImporter::pageCallback | ( | $title | ) |
Notify the callback function when a new "<page>" is reached.
$title | Title |
Definition at line 334 of file Import.php.
References $title.
Referenced by handlePage().
|
private |
Notify the callback function when a "</page>" is closed.
$title | Title | |
$origTitle | Title | |
$revCount | Integer | |
int | $sucCount | number of revisions for which callback returned true |
array | $pageInfo | associative array of page information |
Definition at line 348 of file Import.php.
References $args.
Referenced by handlePage().
|
private |
$logInfo |
Definition at line 557 of file Import.php.
References logItemCallback(), Title\newFromText(), and WikiRevision\setID().
Referenced by handleLogItem().
|
private |
$pageInfo | |
$revisionInfo |
Definition at line 680 of file Import.php.
References revisionCallback(), WikiRevision\setID(), and wfTimestampNow().
Referenced by handleRevision().
|
private |
$text | string |
Definition at line 852 of file Import.php.
References $title, $wgCommandLineMode, array(), global, Title\makeTitleSafe(), Title\newFromText(), and notice().
Referenced by handlePage().
|
private |
$pageInfo | |
$uploadInfo |
Definition at line 791 of file Import.php.
References WikiRevision\setTitle().
Referenced by handleUpload().
|
private |
Notify the callback function of a revision.
$revision | WikiRevision object |
Definition at line 360 of file Import.php.
References array().
Referenced by processRevision().
WikiImporter::setDebug | ( | $debug | ) |
Set debug mode...
$debug | bool |
Definition at line 93 of file Import.php.
References $debug.
WikiImporter::setImageBasePath | ( | $dir | ) |
WikiImporter::setImportUploads | ( | $import | ) |
$import |
Definition at line 245 of file Import.php.
WikiImporter::setLogItemCallback | ( | $callback | ) |
Sets the action to perform as each log item reached.
$callback | callback |
Definition at line 168 of file Import.php.
References $mLogItemCallback.
Referenced by __construct().
WikiImporter::setNoticeCallback | ( | $callback | ) |
Set a callback that displays notice messages.
$callback | callback |
Definition at line 111 of file Import.php.
References wfSetVar().
WikiImporter::setNoUpdates | ( | $noupdates | ) |
Set 'no updates' mode.
In this mode, the link tables will not be updated by the importer
$noupdates | bool |
Definition at line 101 of file Import.php.
WikiImporter::setPageCallback | ( | $callback | ) |
Sets the action to perform as each new page in the stream is reached.
$callback | callback |
Definition at line 120 of file Import.php.
References $mPageCallback.
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.
$callback | callback |
Definition at line 135 of file Import.php.
References $mPageOutCallback.
Referenced by __construct().
WikiImporter::setRevisionCallback | ( | $callback | ) |
Sets the action to perform as each page revision is reached.
$callback | callback |
Definition at line 146 of file Import.php.
References $mRevisionCallback.
Referenced by __construct().
WikiImporter::setSiteInfoCallback | ( | $callback | ) |
Sets the action to perform when site info is encountered.
$callback | callback |
Definition at line 179 of file Import.php.
References $mSiteInfoCallback.
WikiImporter::setTargetNamespace | ( | $namespace | ) |
Set a target namespace to override the defaults.
$namespace |
Definition at line 190 of file Import.php.
Referenced by setTargetRootPage().
WikiImporter::setTargetRootPage | ( | $rootpage | ) |
Set a target root page under which all pages are imported.
$rootpage |
Definition at line 207 of file Import.php.
References $title, $wgContLang, global, MWNamespace\hasSubpages(), Title\newFromText(), Status\newGood(), NS_MAIN, setTargetNamespace(), and wfMessage().
WikiImporter::setUploadCallback | ( | $callback | ) |
Sets the action to perform as each file upload version is reached.
$callback | callback |
Definition at line 157 of file Import.php.
References $mUploadCallback.
Referenced by __construct().
|
private |
Definition at line 63 of file Import.php.
|
private |
Definition at line 74 of file Import.php.
References wfDebug().
Referenced by doImport(), handleLogItem(), handlePage(), handleRevision(), and handleUpload().
WikiImporter::$mDebug |
Definition at line 37 of file Import.php.
WikiImporter::$mImageBasePath |
Definition at line 38 of file Import.php.
|
private |
Definition at line 38 of file Import.php.
|
private |
Definition at line 35 of file Import.php.
Referenced by setLogItemCallback().
|
private |
Definition at line 37 of file Import.php.
|
private |
Definition at line 39 of file Import.php.
WikiImporter::$mPageCallback |
Definition at line 35 of file Import.php.
Referenced by setPageCallback().
WikiImporter::$mPageOutCallback |
Definition at line 36 of file Import.php.
Referenced by setPageOutCallback().
WikiImporter::$mRevisionCallback |
Definition at line 35 of file Import.php.
Referenced by setRevisionCallback().
|
private |
Definition at line 36 of file Import.php.
Referenced by setSiteInfoCallback().
WikiImporter::$mTargetNamespace |
Definition at line 36 of file Import.php.
WikiImporter::$mTargetRootPage |
Definition at line 36 of file Import.php.
WikiImporter::$mUploadCallback |
Definition at line 35 of file Import.php.
Referenced by setUploadCallback().
|
private |
Definition at line 34 of file Import.php.