X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FExtension%2FInfo.php;h=2f14314c078bb685890b78b02e05476cb7ec5fd9;hb=f0b76459410ccaab1c0bf06572abd7a6d8c5ed48;hp=7a0683be43bf6c5539851dbc51269ca741b4e378;hpb=c5afdcccabe7d15c1e1f2e3255a094e5f2a560db;p=civicrm-core.git diff --git a/CRM/Extension/Info.php b/CRM/Extension/Info.php index 7a0683be43..2f14314c07 100644 --- a/CRM/Extension/Info.php +++ b/CRM/Extension/Info.php @@ -44,6 +44,13 @@ class CRM_Extension_Info { */ public $requires = []; + /** + * @var array + * List of expected mixins. + * Ex: ['civix@2.0.0'] + */ + public $mixins = []; + /** * @var array * List of strings (tag-names). @@ -65,6 +72,13 @@ class CRM_Extension_Info { */ public $maintainer = NULL; + /** + * @var string|null + * The name of a class which handles the install/upgrade lifecycle. + * @see \CRM_Extension_Upgrader_Interface + */ + public $upgrader = NULL; + /** * Load extension info an XML file. * @@ -150,13 +164,14 @@ class CRM_Extension_Info { $this->type = (string) $info->attributes()->type; $this->file = (string) $info->file; $this->label = (string) $info->name; + $this->upgrader = (string) $info->upgrader; // Convert first level variables to CRM_Core_Extension properties // and deeper into arrays. An exception for URLS section, since // we want them in special format. foreach ($info as $attr => $val) { if (count($val->children()) == 0) { - $this->$attr = (string) $val; + $this->$attr = trim((string) $val); } elseif ($attr === 'urls') { $this->urls = []; @@ -175,6 +190,13 @@ class CRM_Extension_Info { 'path' => (string) $psr4->attributes()->path, ]; } + foreach ($val->psr0 as $psr0) { + $this->classloader[] = [ + 'type' => 'psr0', + 'prefix' => (string) $psr0->attributes()->prefix, + 'path' => (string) $psr0->attributes()->path, + ]; + } } elseif ($attr === 'tags') { $this->tags = []; @@ -182,6 +204,12 @@ class CRM_Extension_Info { $this->tags[] = (string) $tag; } } + elseif ($attr === 'mixins') { + $this->mixins = []; + foreach ($val->mixin as $mixin) { + $this->mixins[] = (string) $mixin; + } + } elseif ($attr === 'requires') { $this->requires = $this->filterRequirements($val); }