From: Tim Otten Date: Sat, 17 Apr 2021 03:38:14 +0000 (-0700) Subject: info.xml - Parse the `` tag X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=941c09262ed77a0666512460cc217d3f86d7179b;p=civicrm-core.git info.xml - Parse the `` tag --- diff --git a/CRM/Extension/Info.php b/CRM/Extension/Info.php index 55e379caf7..8b8ee51143 100644 --- a/CRM/Extension/Info.php +++ b/CRM/Extension/Info.php @@ -65,6 +65,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,6 +157,7 @@ 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 diff --git a/tests/phpunit/CRM/Extension/InfoTest.php b/tests/phpunit/CRM/Extension/InfoTest.php index 73e577fad8..c801435e95 100644 --- a/tests/phpunit/CRM/Extension/InfoTest.php +++ b/tests/phpunit/CRM/Extension/InfoTest.php @@ -50,6 +50,7 @@ class CRM_Extension_InfoTest extends CiviUnitTestCase { $this->assertEquals('test.foo', $info->key); $this->assertEquals('foo', $info->file); $this->assertEquals('zamboni', $info->typeInfo['extra']); + $this->assertEquals(NULL, $info->upgrader); $this->assertEquals([], $info->requires); } @@ -59,6 +60,7 @@ class CRM_Extension_InfoTest extends CiviUnitTestCase { + CRM_Foo_Upgrader org.civicrm.aorg.civicrm.b "; @@ -72,6 +74,7 @@ class CRM_Extension_InfoTest extends CiviUnitTestCase { $this->assertEquals('CRM_', $info->classloader[1]['prefix']); $this->assertEquals('', $info->classloader[1]['path']); $this->assertEquals('psr0', $info->classloader[1]['type']); + $this->assertEquals('CRM_Foo_Upgrader', $info->upgrader); $this->assertEquals(['org.civicrm.a', 'org.civicrm.b'], $info->requires); }