LimeSurvey API - Master branch

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

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[]

getDescription()

public getDescription() : string
Return values
string

getNodeAsArray()

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
string

isCompatible()

Returns true if this extension config is compatible with this version of LS.

public isCompatible() : bool
Return values
bool

loadFromZip()

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
throws
Exception

at error

Return values
ExtensionConfig

validate()

Check basic properties of the config.xml.

public validate() : bool
Tags
todo

Get detailed error message.

Return values
bool

findConfigXml()

private static findConfigXml(ZipArchive $zip) : string|null
Parameters
$zip : ZipArchive
Return values
string|null

        
On this page

Search results