CRM_Extension_Info
in package
Metadata for an extension (e.g. the extension's "info.xml" file)
Tags
Table of Contents
Constants
- FILENAME = 'info.xml'
- Extension info file name.
Properties
- $authors : array<string|int, mixed>
- $category : string
- $civix : array<string|int, mixed>|null
- $classloader : array<string|int, mixed>
- $comments : string|null
- $compatibility : array<string|int, mixed>
- $description : string|null
- $develStage : string|null
- $downloadUrl : string|null
- Full URL of the zipball for this extension/version.
- $file : string|null
- $key : string|null
- $label : string|null
- $license : string|null
- $maintainer : array<string|int, mixed>|null
- $mixins : array<string|int, mixed>
- $name : string|null
- $ready : string|null
- $releaseDate : string|null
- $requires : array<string|int, mixed>
- $tags : array<string|int, mixed>
- $type : string|null
- $typeInfo : array<string|int, mixed>
- $upgrader : string|null
- $url : string
- $urls : array<string|int, mixed>|null
- $usage : int|null
- $version : string|null
Methods
- __construct() : mixed
- buildReverseMap() : array<string|int, mixed>
- Build a reverse-dependency map.
- filterRequirements() : array<string|int, mixed>
- Filter out invalid requirements, e.g. extensions that have been moved to core.
- loadFromFile() : CRM_Extension_Info
- Load extension info an XML file.
- loadFromString() : CRM_Extension_Info
- Load extension info a string.
- parse() : mixed
- Copy attributes from an XML document to $this
- interpolate() : mixed
Constants
FILENAME
Extension info file name.
public
mixed
FILENAME
= 'info.xml'
Properties
$authors
public
array<string|int, mixed>
$authors
= []
List of authors. Ex: [0 => ['name' => 'Alice', 'email' => 'a@b', 'homepage' => 'https://example.com', 'role' => 'Person']]
$category
public
string
$category
$civix
public
array<string|int, mixed>|null
$civix
$classloader
public
array<string|int, mixed>
$classloader
= []
Each item is a specification like: array('type'=>'psr4', 'namespace'=>'Foo\Bar', 'path'=>'/foo/bar').
$comments
public
string|null
$comments
$compatibility
public
array<string|int, mixed>
$compatibility
Ex: ['ver' => '5.50']
$description
public
string|null
$description
$develStage
public
string|null
$develStage
Ex: 'stable', 'alpha', 'beta'
$downloadUrl
Full URL of the zipball for this extension/version.
public
string|null
$downloadUrl
This property is (usually) only provided on the feed of new/available extensions.
$file
public
string|null
$file
= \NULL
$key
public
string|null
$key
= \NULL
$label
public
string|null
$label
= \NULL
$license
public
string|null
$license
Ex: 'GPL-3.0'
$maintainer
public
array<string|int, mixed>|null
$maintainer
= \NULL
The current maintainer at time of publication. This is deprecated in favor of $authors.
$mixins
public
array<string|int, mixed>
$mixins
= []
List of expected mixins. Ex: ['civix@2.0.0']
$name
public
string|null
$name
= \NULL
$ready
public
string|null
$ready
Ex: 'ready', 'not_ready'
$releaseDate
public
string|null
$releaseDate
Ex: '2025-01-02'
$requires
public
array<string|int, mixed>
$requires
= []
Each item is they key-name of an extension required by this extension.
$tags
public
array<string|int, mixed>
$tags
= []
List of strings (tag-names).
$type
public
string|null
$type
= \NULL
$typeInfo
public
array<string|int, mixed>
$typeInfo
$upgrader
public
string|null
$upgrader
= \NULL
The name of a class which handles the install/upgrade lifecycle.
Tags
$url
public
string
$url
$urls
public
array<string|int, mixed>|null
$urls
Ex: ['Documentation' => 'https://example.org/my-extension/docs']
$usage
public
int|null
$usage
Ex: 1234
$version
public
string|null
$version
Ex: '1.2.3'
Methods
__construct()
public
__construct([string|null $key = NULL ][, string|null $type = NULL ][, string|null $name = NULL ][, string|null $label = NULL ][, string|null $file = NULL ]) : mixed
Parameters
- $key : string|null = NULL
- $type : string|null = NULL
- $name : string|null = NULL
- $label : string|null = NULL
- $file : string|null = NULL
buildReverseMap()
Build a reverse-dependency map.
public
static buildReverseMap(array<string|int, mixed> $infos) : array<string|int, mixed>
Parameters
- $infos : array<string|int, mixed>
-
The universe of available extensions. Ex: $infos['org.civicrm.foobar'] = new CRM_Extension_Info().
Return values
array<string|int, mixed> —If "org.civicrm.api" is required by "org.civicrm.foo", then return array('org.civicrm.api' => array(CRM_Extension_Info[org.civicrm.foo])). Array(string $key => array $requiredBys).
filterRequirements()
Filter out invalid requirements, e.g. extensions that have been moved to core.
public
filterRequirements(SimpleXMLElement $requirements) : array<string|int, mixed>
Parameters
- $requirements : SimpleXMLElement
Return values
array<string|int, mixed>loadFromFile()
Load extension info an XML file.
public
static loadFromFile(string $file) : CRM_Extension_Info
Parameters
- $file : string
Tags
Return values
CRM_Extension_InfoloadFromString()
Load extension info a string.
public
static loadFromString(string $string) : CRM_Extension_Info
Parameters
- $string : string
-
XML content.
Tags
Return values
CRM_Extension_Infoparse()
Copy attributes from an XML document to $this
public
parse(SimpleXMLElement $info[, bool $useVariables = TRUE ]) : mixed
Parameters
- $info : SimpleXMLElement
- $useVariables : bool = TRUE
-
Whether to interpolate variables like [civicrm.version]
interpolate()
private
interpolate(mixed $value, mixed $vars) : mixed
Parameters
- $value : mixed
- $vars : mixed