MediaWiki REL1_31
SiteImporter Class Reference
Collaboration diagram for SiteImporter:

Public Member Functions

 __construct (SiteStore $store)
 
 getExceptionCallback ()
 
 importFromFile ( $file)
 
 importFromXML ( $xml)
 
 makeSite (DOMElement $siteElement)
 
 setExceptionCallback ( $exceptionCallback)
 

Private Member Functions

 getAttributeValue (DOMElement $element, $name, $default=false)
 
 getChildText (DOMElement $element, $name, $default=false)
 
 handleException (Exception $ex)
 
 hasChild (DOMElement $element, $name)
 
 importFromDOM (DOMElement $root)
 
 makeSiteList (DOMElement $root)
 

Private Attributes

callable null $exceptionCallback
 
SiteStore $store
 

Detailed Description

Definition at line 30 of file SiteImporter.php.

Constructor & Destructor Documentation

◆ __construct()

SiteImporter::__construct ( SiteStore $store)
Parameters
SiteStore$store

Definition at line 45 of file SiteImporter.php.

References $store.

Member Function Documentation

◆ getAttributeValue()

SiteImporter::getAttributeValue ( DOMElement $element,
$name,
$default = false )
private
Parameters
DOMElement$element
string$name
string | null | bool$default
Returns
null|string
Exceptions
MWExceptionIf the attribute is not found and no default is provided

Definition at line 203 of file SiteImporter.php.

Referenced by makeSite().

◆ getChildText()

SiteImporter::getChildText ( DOMElement $element,
$name,
$default = false )
private
Parameters
DOMElement$element
string$name
string | null | bool$default
Returns
null|string
Exceptions
MWExceptionIf the child element is not found and no default is provided

Definition at line 227 of file SiteImporter.php.

Referenced by hasChild(), and makeSite().

◆ getExceptionCallback()

SiteImporter::getExceptionCallback ( )
Returns
callable

Definition at line 52 of file SiteImporter.php.

References $exceptionCallback.

◆ handleException()

SiteImporter::handleException ( Exception $ex)
private
Parameters
Exception$ex

Definition at line 258 of file SiteImporter.php.

References wfLogWarning().

Referenced by makeSiteList().

◆ hasChild()

SiteImporter::hasChild ( DOMElement $element,
$name )
private
Parameters
DOMElement$element
string$name
Returns
bool
Exceptions
MWException

Definition at line 251 of file SiteImporter.php.

References getChildText().

Referenced by makeSite().

◆ importFromDOM()

SiteImporter::importFromDOM ( DOMElement $root)
private
Parameters
DOMElement$root

Definition at line 111 of file SiteImporter.php.

References makeSiteList().

Referenced by importFromXML().

◆ importFromFile()

SiteImporter::importFromFile ( $file)
Parameters
string$file

Definition at line 66 of file SiteImporter.php.

References importFromXML().

◆ importFromXML()

SiteImporter::importFromXML ( $xml)
Parameters
string$xml
Exceptions
InvalidArgumentException

Definition at line 81 of file SiteImporter.php.

References importFromDOM().

Referenced by importFromFile().

◆ makeSite()

SiteImporter::makeSite ( DOMElement $siteElement)
Parameters
DOMElement$siteElement
Returns
Site
Exceptions
InvalidArgumentException

Definition at line 158 of file SiteImporter.php.

References $type, getAttributeValue(), getChildText(), Site\GROUP_NONE, hasChild(), Site\newForType(), Site\SOURCE_LOCAL, and Site\TYPE_UNKNOWN.

Referenced by makeSiteList().

◆ makeSiteList()

SiteImporter::makeSiteList ( DOMElement $root)
private
Parameters
DOMElement$root
Returns
Site[]

Definition at line 121 of file SiteImporter.php.

References handleException(), and makeSite().

Referenced by importFromDOM().

◆ setExceptionCallback()

SiteImporter::setExceptionCallback ( $exceptionCallback)
Parameters
callable$exceptionCallback

Definition at line 59 of file SiteImporter.php.

References $exceptionCallback.

Member Data Documentation

◆ $exceptionCallback

callable null SiteImporter::$exceptionCallback
private

Definition at line 40 of file SiteImporter.php.

Referenced by getExceptionCallback(), and setExceptionCallback().

◆ $store

SiteStore SiteImporter::$store
private

Definition at line 35 of file SiteImporter.php.

Referenced by __construct().


The documentation for this class was generated from the following file: