MediaWiki
REL1_24
|
XML file reader for the page data importer. More...
Public Member Functions | |
__construct (ImportStreamSource $source) | |
Creates an ImportXMLReader drawing from the source provided. | |
debug ($data) | |
debugRevisionHandler (&$revision) | |
Alternate per-revision callback, for debugging. | |
doImport () | |
Primary entry point. | |
finishImportPage ($title, $origTitle, $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) | |
pageCallback ($title) | |
Notify the callback function when a new "<page>" is reached. | |
setDebug ($debug) | |
Set debug mode... | |
setImageBasePath ($dir) | |
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. | |
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. | |
throwXmlError ($err) | |
warn ($data) | |
Public Attributes | |
$mDebug | |
$mImageBasePath | |
$mPageCallback | |
$mPageOutCallback | |
$mRevisionCallback | |
$mTargetNamespace | |
$mTargetRootPage | |
$mUploadCallback | |
Private Member Functions | |
dumpTemp ($contents) | |
handleContributor () | |
handleLogItem () | |
handlePage () | |
handleRevision (&$pageInfo) | |
handleSiteInfo () | |
handleUpload (&$pageInfo) | |
logItemCallback ($revision) | |
Notify the callback function of a new log item. | |
pageOutCallback ($title, $origTitle, $revCount, $sucCount, $pageInfo) | |
Notify the callback function when a "</page>" is closed. | |
processLogItem ($logInfo) | |
processRevision ($pageInfo, $revisionInfo) | |
processTitle ($text) | |
processUpload ($pageInfo, $uploadInfo) | |
revisionCallback ($revision) | |
Notify the callback function of a revision. | |
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 | ( | ImportStreamSource $ | source | ) |
Creates an ImportXMLReader drawing from the source provided.
ImportStreamSource | $source |
Definition at line 45 of file Import.php.
References array(), UploadSourceAdapter\registerSource(), setLogItemCallback(), setPageOutCallback(), setRevisionCallback(), and setUploadCallback().
WikiImporter::debug | ( | $ | data | ) |
Definition at line 77 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.
WikiRevision | $revision |
Definition at line 330 of file Import.php.
References debug().
Primary entry point.
MWException |
Definition at line 437 of file Import.php.
References $type, array(), debug(), handleLogItem(), handlePage(), handleSiteInfo(), warn(), and wfRunHooks().
WikiImporter::dumpTemp | ( | $ | contents | ) | [private] |
string | $contents |
Definition at line 777 of file Import.php.
References wfTempDir().
Referenced by handleUpload().
WikiImporter::finishImportPage | ( | $ | title, |
$ | origTitle, | ||
$ | revCount, | ||
$ | sRevCount, | ||
$ | pageInfo | ||
) |
Mostly for hook use.
Title | $title | |
string | $origTitle | |
int | $revCount | |
int | $sRevCount | |
array | $pageInfo |
Definition at line 321 of file Import.php.
References wfRunHooks().
Definition at line 68 of file Import.php.
WikiImporter::handleContributor | ( | ) | [private] |
Definition at line 825 of file Import.php.
References array(), and nodeContents().
Referenced by handleLogItem(), handleRevision(), and handleUpload().
WikiImporter::handleLogItem | ( | ) | [private] |
Definition at line 502 of file Import.php.
References array(), debug(), handleContributor(), nodeContents(), processLogItem(), warn(), and wfRunHooks().
Referenced by doImport().
WikiImporter::handlePage | ( | ) | [private] |
Definition at line 563 of file Import.php.
References $title, array(), debug(), handleRevision(), handleUpload(), list, nodeAttribute(), nodeContents(), pageCallback(), pageOutCallback(), processTitle(), warn(), and wfRunHooks().
Referenced by doImport().
WikiImporter::handleRevision | ( | &$ | pageInfo | ) | [private] |
array | $pageInfo |
Definition at line 631 of file Import.php.
References array(), debug(), handleContributor(), nodeContents(), processRevision(), warn(), and wfRunHooks().
Referenced by handlePage().
WikiImporter::handleSiteInfo | ( | ) | [private] |
MWException |
Definition at line 492 of file Import.php.
Referenced by doImport().
WikiImporter::handleUpload | ( | &$ | pageInfo | ) | [private] |
array | $pageInfo |
Definition at line 722 of file Import.php.
References $path, array(), debug(), dumpTemp(), handleContributor(), nodeContents(), processUpload(), warn(), and wfRunHooks().
Referenced by handlePage().
WikiImporter::importLogItem | ( | $ | revision | ) |
Default per-revision callback, performs the import.
WikiRevision | $revision |
Definition at line 297 of file Import.php.
WikiImporter::importRevision | ( | $ | revision | ) |
Default per-revision callback, performs the import.
WikiRevision | $revision |
Definition at line 267 of file Import.php.
WikiImporter::importUpload | ( | $ | revision | ) |
Dummy for now...
WikiRevision | $revision |
Definition at line 307 of file Import.php.
WikiImporter::logItemCallback | ( | $ | revision | ) | [private] |
Notify the callback function of a new log item.
WikiRevision | $revision |
Definition at line 387 of file Import.php.
References array().
Referenced by processLogItem().
WikiImporter::nodeAttribute | ( | $ | attr | ) |
Retrieves the contents of the named attribute of the current element.
string | $attr | The name of the attribute |
Definition at line 401 of file Import.php.
Referenced by handlePage().
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 412 of file Import.php.
Referenced by handleContributor(), handleLogItem(), handlePage(), handleRevision(), and handleUpload().
WikiImporter::notice | ( | $ | msg | ) |
Definition at line 87 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 347 of file Import.php.
References $title.
Referenced by handlePage().
WikiImporter::pageOutCallback | ( | $ | title, |
$ | origTitle, | ||
$ | revCount, | ||
$ | sucCount, | ||
$ | pageInfo | ||
) | [private] |
Notify the callback function when a "</page>" is closed.
Title | $title | |
Title | $origTitle | |
int | $revCount | |
int | $sucCount | Number of revisions for which callback returned true |
array | $pageInfo | Associative array of page information |
Definition at line 361 of file Import.php.
Referenced by handlePage().
WikiImporter::processLogItem | ( | $ | logInfo | ) | [private] |
array | $logInfo |
Definition at line 538 of file Import.php.
References logItemCallback(), Title\newFromText(), and WikiRevision\setID().
Referenced by handleLogItem().
WikiImporter::processRevision | ( | $ | pageInfo, |
$ | revisionInfo | ||
) | [private] |
array | $pageInfo | |
array | $revisionInfo |
Definition at line 672 of file Import.php.
References revisionCallback(), WikiRevision\setID(), and wfTimestampNow().
Referenced by handleRevision().
WikiImporter::processTitle | ( | $ | text | ) | [private] |
string | $text |
Definition at line 849 of file Import.php.
References $title, $wgCommandLineMode, array(), global, Title\makeTitleSafe(), Title\newFromText(), and notice().
Referenced by handlePage().
WikiImporter::processUpload | ( | $ | pageInfo, |
$ | uploadInfo | ||
) | [private] |
array | $pageInfo | |
array | $uploadInfo |
Definition at line 788 of file Import.php.
References empty, and WikiRevision\setTitle().
Referenced by handleUpload().
WikiImporter::revisionCallback | ( | $ | revision | ) | [private] |
Notify the callback function of a revision.
WikiRevision | $revision |
Definition at line 373 of file Import.php.
References array().
Referenced by processRevision().
WikiImporter::setDebug | ( | $ | debug | ) |
Set debug mode...
bool | $debug |
Definition at line 102 of file Import.php.
References $debug.
WikiImporter::setImageBasePath | ( | $ | dir | ) |
WikiImporter::setImportUploads | ( | $ | import | ) |
bool | $import |
Definition at line 258 of file Import.php.
WikiImporter::setLogItemCallback | ( | $ | callback | ) |
Sets the action to perform as each log item reached.
callable | $callback |
Definition at line 177 of file Import.php.
Referenced by __construct().
WikiImporter::setNoticeCallback | ( | $ | callback | ) |
Set a callback that displays notice messages.
callable | $callback |
Definition at line 120 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
bool | $noupdates |
Definition at line 110 of file Import.php.
WikiImporter::setPageCallback | ( | $ | callback | ) |
Sets the action to perform as each new page in the stream is reached.
callable | $callback |
Definition at line 129 of file Import.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 | $callback |
Definition at line 144 of file Import.php.
Referenced by __construct().
WikiImporter::setRevisionCallback | ( | $ | callback | ) |
Sets the action to perform as each page revision is reached.
callable | $callback |
Definition at line 155 of file Import.php.
Referenced by __construct().
WikiImporter::setSiteInfoCallback | ( | $ | callback | ) |
Sets the action to perform when site info is encountered.
callable | $callback |
Definition at line 188 of file Import.php.
WikiImporter::setTargetNamespace | ( | $ | namespace | ) |
Set a target namespace to override the defaults.
null | int | $namespace |
Definition at line 199 of file Import.php.
Referenced by setTargetRootPage().
WikiImporter::setTargetRootPage | ( | $ | rootpage | ) |
Set a target root page under which all pages are imported.
null | string | $rootpage |
Definition at line 216 of file Import.php.
References $title, $wgContLang, global, MWNamespace\hasSubpages(), Title\newFromText(), Status\newGood(), setTargetNamespace(), and wfMessage().
WikiImporter::setUploadCallback | ( | $ | callback | ) |
Sets the action to perform as each file upload version is reached.
callable | $callback |
Definition at line 166 of file Import.php.
Referenced by __construct().
WikiImporter::throwXmlError | ( | $ | err | ) |
Definition at line 72 of file Import.php.
WikiImporter::warn | ( | $ | data | ) |
Definition at line 83 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.
WikiImporter::$mImportUploads [private] |
Definition at line 38 of file Import.php.
WikiImporter::$mLogItemCallback [private] |
Definition at line 35 of file Import.php.
WikiImporter::$mNoticeCallback [private] |
Definition at line 37 of file Import.php.
WikiImporter::$mNoUpdates = false [private] |
Definition at line 39 of file Import.php.
WikiImporter::$mPageCallback |
Definition at line 35 of file Import.php.
WikiImporter::$mPageOutCallback |
Definition at line 36 of file Import.php.
WikiImporter::$mRevisionCallback |
Definition at line 35 of file Import.php.
WikiImporter::$mSiteInfoCallback [private] |
Definition at line 36 of file Import.php.
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.
WikiImporter::$reader = null [private] |
Definition at line 34 of file Import.php.