3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * Track minimal information which identifies the target extension.
15 trait CRM_Extension_Upgrader_IdentityTrait
{
19 * eg 'com.example.myextension'
21 protected $extensionName;
25 * full path to the extension's source tree
27 protected $extensionDir;
32 public function init(array $params) {
33 $this->extensionName
= $params['key'];
34 $system = CRM_Extension_System
::singleton();
35 $mapper = $system->getMapper();
36 $this->extensionDir
= $mapper->keyToBasePath($this->extensionName
);
41 * Ex: 'org.example.foobar'
43 public function getExtensionKey() {
44 return $this->extensionName
;
49 * Ex: '/var/www/sites/default/ext/org.example.foobar'
51 public function getExtensionDir() {
52 return $this->extensionDir
;