info.xml - Allow extensions to define a list of tags
authorTim Otten <totten@civicrm.org>
Sat, 15 Feb 2020 01:24:40 +0000 (17:24 -0800)
committerTim Otten <totten@civicrm.org>
Sat, 15 Feb 2020 01:36:43 +0000 (17:36 -0800)
commit9bb46670bd3f1acd3b078cf2fd73925b5d94ed35
treedf0fdbcac0bcd89c54911c246ed8218eae89d47f
parentd25ba73957d88f37fcfd3e6aa3f04b5930ec022d
info.xml - Allow extensions to define a list of tags

Overview
--------

This adopts a convention by which extensions may use `info.xml` to register tags, e.g.

```xml
<extension key="org.civicrm.foo" type="module">
  <tags>
    <tag>civicontribute</tag>
    <tag>payment-processor</tag>
    <tag>install-mandatory</tag>
  </tags>
</extension>
```

Before
------

To add *any* metadata to `info.xml` files, you must update the parser and providing
filtering/indexing.

After
-----

If you need to add very simple metadata (tags), you can do that without
extra parsing code.  The tag information can be accessed in the following
ways:

* Using the extension mapper
    ```php
    $mapper = CRM_Extension_System::singleton()->getMapper();
    $allTags = $mapper->getAllTags();
    $mandatoryExts = $mapper->getKeysByTag('install-mandatory');
    ```
* The `Extension.get` API will return the list of tags for each ext
CRM/Extension/Info.php
CRM/Extension/Mapper.php
tests/extensions/test.extension.manager.moduletest/info.xml
tests/extensions/test.extension.manager.paymenttest/info.xml
tests/phpunit/CRM/Extension/MapperTest.php
tests/phpunit/api/v3/ExtensionTest.php