MediaWiki  1.28.0
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

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

Definition at line 45 of file SiteImporter.php.

References $store, and store.

Member Function Documentation

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

Definition at line 200 of file SiteImporter.php.

References $name.

Referenced by makeSite().

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 224 of file SiteImporter.php.

References $name.

Referenced by hasChild(), and makeSite().

SiteImporter::getExceptionCallback ( )
Returns
callable

Definition at line 52 of file SiteImporter.php.

References $exceptionCallback.

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

Definition at line 255 of file SiteImporter.php.

References wfLogWarning().

Referenced by makeSiteList().

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

Definition at line 248 of file SiteImporter.php.

References $name, and getChildText().

Referenced by makeSite().

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

Definition at line 108 of file SiteImporter.php.

References makeSiteList(), and store.

Referenced by importFromXML().

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

Definition at line 66 of file SiteImporter.php.

References importFromXML().

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

Definition at line 81 of file SiteImporter.php.

References as, and importFromDOM().

Referenced by importFromFile().

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

Definition at line 155 of file SiteImporter.php.

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

Referenced by makeSiteList().

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

Definition at line 118 of file SiteImporter.php.

References handleException(), makeSite(), and store.

Referenced by importFromDOM().

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

Definition at line 59 of file SiteImporter.php.

References $exceptionCallback.

Member Data Documentation

callable null SiteImporter::$exceptionCallback
private

Definition at line 40 of file SiteImporter.php.

Referenced by getExceptionCallback(), and setExceptionCallback().

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: