3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * The extension manager handles installing, disabling enabling, and
30 * uninstalling extensions.
33 * @copyright CiviCRM LLC (c) 2004-2017
35 class CRM_Extension_Manager_Base
implements CRM_Extension_Manager_Interface
{
38 * @var bool hether to automatically uninstall and install during 'replace'
43 * @param bool $autoReplace
44 * Whether to automatically uninstall and install during 'replace'.
46 public function __construct($autoReplace = FALSE) {
47 $this->autoReplace
= $autoReplace;
53 * @param CRM_Extension_Info $info
55 public function onPreInstall(CRM_Extension_Info
$info) {
61 * @param CRM_Extension_Info $info
63 public function onPostInstall(CRM_Extension_Info
$info) {
69 * @param CRM_Extension_Info $info
71 public function onPostPostInstall(CRM_Extension_Info
$info) {
77 * @param CRM_Extension_Info $info
79 public function onPreEnable(CRM_Extension_Info
$info) {
85 * @param CRM_Extension_Info $info
87 public function onPostEnable(CRM_Extension_Info
$info) {
93 * @param CRM_Extension_Info $info
95 public function onPreDisable(CRM_Extension_Info
$info) {
101 * @param CRM_Extension_Info $info
103 public function onPostDisable(CRM_Extension_Info
$info) {
109 * @param CRM_Extension_Info $info
111 public function onPreUninstall(CRM_Extension_Info
$info) {
117 * @param CRM_Extension_Info $info
119 public function onPostUninstall(CRM_Extension_Info
$info) {
125 * @param CRM_Extension_Info $oldInfo
126 * @param CRM_Extension_Info $newInfo
128 public function onPreReplace(CRM_Extension_Info
$oldInfo, CRM_Extension_Info
$newInfo) {
129 if ($this->autoReplace
) {
130 $this->onPreUninstall($oldInfo);
131 $this->onPostUninstall($oldInfo);
138 * @param CRM_Extension_Info $oldInfo
139 * @param CRM_Extension_Info $newInfo
141 public function onPostReplace(CRM_Extension_Info
$oldInfo, CRM_Extension_Info
$newInfo) {
142 if ($this->autoReplace
) {
143 $this->onPreInstall($oldInfo);
144 $this->onPostInstall($oldInfo);