ExtensionConfig
in package
Thin wrapper class around extension config.xml file.
Table of Contents
Properties
- $xml : SimpleXMLElement
Methods
- __construct() : mixed
- createVersionFetchers() : array<string|int, mixed>
- Create a version fetcher for every <updater> tag in config.xml.
- getAuthor() : string
- getDescription() : string
- getLicense() : string
- getName() : string
- getNodeAsArray() : array<string|int, mixed>
- Returns the $nodeName XML node as an array
- getVersion() : string
- Version is a string, not number, due to semantic versioning.
- isCompatible() : bool
- Returns true if this extension config is compatible with this version of LS.
- loadFromFile() : ExtensionConfig
- Reads xml from file and creates an instance of ExtensionConfig
- loadFromZip() : ExtensionConfig
- Create an ExtensionConfig from config.xml inside zip $filePath config.xml can be in a subfolder.
- validate() : bool
- Check basic properties of the config.xml.
- findConfigXml() : string|null
Properties
$xml
public
SimpleXMLElement
$xml
Methods
__construct()
public
__construct(SimpleXMLElement $xml) : mixed
Parameters
- $xml : SimpleXMLElement
createVersionFetchers()
Create a version fetcher for every <updater> tag in config.xml.
public
createVersionFetchers() : array<string|int, mixed>
Return values
array<string|int, mixed> —VersionFetcher[]
getAuthor()
public
getAuthor() : string
Return values
stringgetDescription()
public
getDescription() : string
Return values
stringgetLicense()
public
getLicense() : string
Return values
stringgetName()
public
getName() : string
Return values
stringgetNodeAsArray()
Returns the $nodeName XML node as an array
public
getNodeAsArray(string $nodeName) : array<string|int, mixed>
Parameters
- $nodeName : string
-
the name of the node to retrieve
Return values
array<string|int, mixed> —the node contents as an array
getVersion()
Version is a string, not number, due to semantic versioning.
public
getVersion() : string
Return values
stringisCompatible()
Returns true if this extension config is compatible with this version of LS.
public
isCompatible() : bool
Return values
boolloadFromFile()
Reads xml from file and creates an instance of ExtensionConfig
public
static loadFromFile(string $file) : ExtensionConfig
Parameters
- $file : string
-
Full file path.
Return values
ExtensionConfigloadFromZip()
Create an ExtensionConfig from config.xml inside zip $filePath config.xml can be in a subfolder.
public
static loadFromZip(string $filePath) : ExtensionConfig
Parameters
- $filePath : string
-
Full file path.
Tags
Return values
ExtensionConfigvalidate()
Check basic properties of the config.xml.
public
validate() : bool
Tags
Return values
boolfindConfigXml()
private
static findConfigXml(ZipArchive $zip) : string|null
Parameters
- $zip : ZipArchive