[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/ -> Import.php (summary)

MediaWiki page data importer. Copyright © 2003,2005 Brion Vibber <[email protected]> https://www.mediawiki.org/

File Size: 1800 lines (44 kb)
Included or required:0 times
Referenced: 5 times
Includes or requires: 0 files

Defines 5 classes

WikiImporter:: (42 methods):
  __construct()
  getReader()
  throwXmlError()
  debug()
  warn()
  notice()
  setDebug()
  setNoUpdates()
  setNoticeCallback()
  setPageCallback()
  setPageOutCallback()
  setRevisionCallback()
  setUploadCallback()
  setLogItemCallback()
  setSiteInfoCallback()
  setTargetNamespace()
  setTargetRootPage()
  setImageBasePath()
  setImportUploads()
  importRevision()
  importLogItem()
  importUpload()
  finishImportPage()
  debugRevisionHandler()
  pageCallback()
  pageOutCallback()
  revisionCallback()
  logItemCallback()
  nodeAttribute()
  nodeContents()
  doImport()
  handleSiteInfo()
  handleLogItem()
  processLogItem()
  handlePage()
  handleRevision()
  processRevision()
  handleUpload()
  dumpTemp()
  processUpload()
  handleContributor()
  processTitle()

UploadSourceAdapter:: (7 methods):
  registerSource()
  stream_open()
  stream_read()
  stream_write()
  stream_tell()
  stream_eof()
  url_stat()

WikiRevision:: (45 methods):
  setTitle()
  setID()
  setTimestamp()
  setUsername()
  setUserIP()
  setModel()
  setFormat()
  setText()
  setComment()
  setMinor()
  setSrc()
  setFileSrc()
  setSha1Base36()
  setFilename()
  setArchiveName()
  setSize()
  setType()
  setAction()
  setParams()
  setNoUpdates()
  getTitle()
  getID()
  getTimestamp()
  getUser()
  getText()
  getContentHandler()
  getContent()
  getModel()
  getFormat()
  getComment()
  getMinor()
  getSrc()
  getSha1()
  getFileSrc()
  isTempSrc()
  getFilename()
  getArchiveName()
  getSize()
  getType()
  getAction()
  getParams()
  importOldRevision()
  importLogItem()
  importUpload()
  downloadSource()

ImportStringSource:: (3 methods):
  __construct()
  atEnd()
  readChunk()

ImportStreamSource:: (7 methods):
  __construct()
  atEnd()
  readChunk()
  newFromFile()
  newFromUpload()
  newFromURL()
  newFromInterwiki()


Class: WikiImporter  - X-Ref

XML file reader for the page data importer

implements Special:Import
__construct( ImportStreamSource $source )   X-Ref
Creates an ImportXMLReader drawing from the source provided

param: ImportStreamSource $source

getReader()   X-Ref

return: null|XMLReader

throwXmlError( $err )   X-Ref
No description

debug( $data )   X-Ref
No description

warn( $data )   X-Ref
No description

notice( $msg )   X-Ref
No description

setDebug( $debug )   X-Ref
Set debug mode...

param: bool $debug

setNoUpdates( $noupdates )   X-Ref
Set 'no updates' mode. In this mode, the link tables will not be updated by the importer

param: bool $noupdates

setNoticeCallback( $callback )   X-Ref
Set a callback that displays notice messages

param: callable $callback
return: callable

setPageCallback( $callback )   X-Ref
Sets the action to perform as each new page in the stream is reached.

param: callable $callback
return: callable

setPageOutCallback( $callback )   X-Ref
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.

param: callable $callback
return: callable

setRevisionCallback( $callback )   X-Ref
Sets the action to perform as each page revision is reached.

param: callable $callback
return: callable

setUploadCallback( $callback )   X-Ref
Sets the action to perform as each file upload version is reached.

param: callable $callback
return: callable

setLogItemCallback( $callback )   X-Ref
Sets the action to perform as each log item reached.

param: callable $callback
return: callable

setSiteInfoCallback( $callback )   X-Ref
Sets the action to perform when site info is encountered

param: callable $callback
return: callable

setTargetNamespace( $namespace )   X-Ref
Set a target namespace to override the defaults

param: null|int $namespace
return: bool

setTargetRootPage( $rootpage )   X-Ref
Set a target root page under which all pages are imported

param: null|string $rootpage
return: Status

setImageBasePath( $dir )   X-Ref

param: string $dir

setImportUploads( $import )   X-Ref

param: bool $import

importRevision( $revision )   X-Ref
Default per-revision callback, performs the import.

param: WikiRevision $revision
return: bool

importLogItem( $revision )   X-Ref
Default per-revision callback, performs the import.

param: WikiRevision $revision
return: bool

importUpload( $revision )   X-Ref
Dummy for now...

param: WikiRevision $revision
return: bool

finishImportPage( $title, $origTitle, $revCount, $sRevCount, $pageInfo )   X-Ref
Mostly for hook use

param: Title $title
param: string $origTitle
param: int $revCount
param: int $sRevCount
param: array $pageInfo
return: bool

debugRevisionHandler( &$revision )   X-Ref
Alternate per-revision callback, for debugging.

param: WikiRevision $revision

pageCallback( $title )   X-Ref
Notify the callback function when a new "<page>" is reached.

param: Title $title

pageOutCallback( $title, $origTitle, $revCount, $sucCount, $pageInfo )   X-Ref
Notify the callback function when a "</page>" is closed.

param: Title $title
param: Title $origTitle
param: int $revCount
param: int $sucCount Number of revisions for which callback returned true
param: array $pageInfo Associative array of page information

revisionCallback( $revision )   X-Ref
Notify the callback function of a revision

param: WikiRevision $revision
return: bool|mixed

logItemCallback( $revision )   X-Ref
Notify the callback function of a new log item

param: WikiRevision $revision
return: bool|mixed

nodeAttribute( $attr )   X-Ref
Retrieves the contents of the named attribute of the current element.

param: string $attr The name of the attribute
return: string The value of the attribute or an empty string if it is not set in the current element.

nodeContents()   X-Ref
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.

return: string

doImport()   X-Ref
Primary entry point

return: bool

handleSiteInfo()   X-Ref

return: bool

handleLogItem()   X-Ref
No description

processLogItem( $logInfo )   X-Ref

param: array $logInfo
return: bool|mixed

handlePage()   X-Ref
No description

handleRevision( &$pageInfo )   X-Ref

param: array $pageInfo

processRevision( $pageInfo, $revisionInfo )   X-Ref

param: array $pageInfo
param: array $revisionInfo
return: bool|mixed

handleUpload( &$pageInfo )   X-Ref

param: array $pageInfo
return: mixed

dumpTemp( $contents )   X-Ref

param: string $contents
return: string

processUpload( $pageInfo, $uploadInfo )   X-Ref

param: array $pageInfo
param: array $uploadInfo
return: mixed

handleContributor()   X-Ref

return: array

processTitle( $text )   X-Ref

param: string $text
return: array|bool

Class: UploadSourceAdapter  - X-Ref

registerSource( ImportStreamSource $source )   X-Ref

param: ImportStreamSource $source
return: string

stream_open( $path, $mode, $options, &$opened_path )   X-Ref

param: string $path
param: string $mode
param: array $options
param: string $opened_path
return: bool

stream_read( $count )   X-Ref

param: int $count
return: string

stream_write( $data )   X-Ref

param: string $data
return: bool

stream_tell()   X-Ref

return: mixed

stream_eof()   X-Ref

return: bool

url_stat()   X-Ref

return: array

Class: WikiRevision  - X-Ref


setTitle( $title )   X-Ref

param: Title $title

setID( $id )   X-Ref

param: int $id

setTimestamp( $ts )   X-Ref

param: string $ts

setUsername( $user )   X-Ref

param: string $user

setUserIP( $ip )   X-Ref

param: string $ip

setModel( $model )   X-Ref

param: string $model

setFormat( $format )   X-Ref

param: string $format

setText( $text )   X-Ref

param: string $text

setComment( $text )   X-Ref

param: string $text

setMinor( $minor )   X-Ref

param: bool $minor

setSrc( $src )   X-Ref

param: mixed $src

setFileSrc( $src, $isTemp )   X-Ref

param: string $src
param: bool $isTemp

setSha1Base36( $sha1base36 )   X-Ref

param: string $sha1base36

setFilename( $filename )   X-Ref

param: string $filename

setArchiveName( $archiveName )   X-Ref

param: string $archiveName

setSize( $size )   X-Ref

param: int $size

setType( $type )   X-Ref

param: string $type

setAction( $action )   X-Ref

param: string $action

setParams( $params )   X-Ref

param: array $params

setNoUpdates( $noupdates )   X-Ref

param: bool $noupdates

getTitle()   X-Ref

return: Title

getID()   X-Ref

return: int

getTimestamp()   X-Ref

return: string

getUser()   X-Ref

return: string

getText()   X-Ref

return: string

getContentHandler()   X-Ref

return: ContentHandler

getContent()   X-Ref

return: Content

getModel()   X-Ref

return: string

getFormat()   X-Ref

return: string

getComment()   X-Ref

return: string

getMinor()   X-Ref

return: bool

getSrc()   X-Ref

return: mixed

getSha1()   X-Ref

return: bool|string

getFileSrc()   X-Ref

return: string

isTempSrc()   X-Ref

return: bool

getFilename()   X-Ref

return: mixed

getArchiveName()   X-Ref

return: string

getSize()   X-Ref

return: mixed

getType()   X-Ref

return: string

getAction()   X-Ref

return: string

getParams()   X-Ref

return: string

importOldRevision()   X-Ref

return: bool

importLogItem()   X-Ref
No description

importUpload()   X-Ref

return: bool

downloadSource()   X-Ref

return: bool|string

Class: ImportStringSource  - X-Ref


__construct( $string )   X-Ref
No description

atEnd()   X-Ref

return: bool

readChunk()   X-Ref

return: bool|string

Class: ImportStreamSource  - X-Ref


__construct( $handle )   X-Ref
No description

atEnd()   X-Ref

return: bool

readChunk()   X-Ref

return: string

newFromFile( $filename )   X-Ref

param: string $filename
return: Status

newFromUpload( $fieldname = "xmlimport" )   X-Ref

param: string $fieldname
return: Status

newFromURL( $url, $method = 'GET' )   X-Ref

param: string $url
param: string $method
return: Status

newFromInterwiki( $interwiki, $page, $history = false,$templates = false, $pageLinkDepth = 0)   X-Ref

param: string $interwiki
param: string $page
param: bool $history
param: bool $templates
param: int $pageLinkDepth
return: Status



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1