mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
Extension installation improvements
This commit is contained in:
@@ -73,7 +73,9 @@ class Install extends \Espo\Core\Upgrades\Actions\Base
|
||||
}
|
||||
|
||||
/* run before install script */
|
||||
$this->runScript('before');
|
||||
if (!isset($data['skipBeforeScript']) || !$data['skipBeforeScript']) {
|
||||
$this->runScript('before');
|
||||
}
|
||||
|
||||
/* remove files defined in a manifest "deleteBeforeCopy" */
|
||||
$this->deleteFiles('deleteBeforeCopy', true);
|
||||
@@ -89,8 +91,10 @@ class Install extends \Espo\Core\Upgrades\Actions\Base
|
||||
$this->deleteFiles('vendor');
|
||||
$this->copyFiles('vendor');
|
||||
|
||||
if (!$this->systemRebuild()) {
|
||||
$this->throwErrorAndRemovePackage('Error occurred while EspoCRM rebuild.');
|
||||
if (!isset($data['skipSystemRebuild']) || !$data['skipSystemRebuild']) {
|
||||
if (!$this->systemRebuild()) {
|
||||
$this->throwErrorAndRemovePackage('Error occurred while EspoCRM rebuild.');
|
||||
}
|
||||
}
|
||||
|
||||
//afterInstallFiles
|
||||
@@ -99,7 +103,9 @@ class Install extends \Espo\Core\Upgrades\Actions\Base
|
||||
}
|
||||
|
||||
/* run before install script */
|
||||
$this->runScript('after');
|
||||
if (!isset($data['skipAfterScript']) || !$data['skipAfterScript']) {
|
||||
$this->runScript('after');
|
||||
}
|
||||
|
||||
$this->afterRunAction();
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class Uninstall extends \Espo\Core\Upgrades\Actions\Base
|
||||
$this->beforeRunAction();
|
||||
|
||||
/* run before install script */
|
||||
if (!isset($data['isNotRunScriptBefore']) || !$data['isNotRunScriptBefore']) {
|
||||
if (!isset($data['skipBeforeScript']) || !$data['skipBeforeScript']) {
|
||||
$this->runScript('beforeUninstall');
|
||||
}
|
||||
|
||||
@@ -71,12 +71,14 @@ class Uninstall extends \Espo\Core\Upgrades\Actions\Base
|
||||
}
|
||||
}
|
||||
|
||||
if (!$this->systemRebuild()) {
|
||||
$this->throwErrorAndRemovePackage('Error occurred while EspoCRM rebuild.');
|
||||
if (!isset($data['skipSystemRebuild']) || !$data['skipSystemRebuild']) {
|
||||
if (!$this->systemRebuild()) {
|
||||
$this->throwErrorAndRemovePackage('Error occurred while EspoCRM rebuild.');
|
||||
}
|
||||
}
|
||||
|
||||
/* run after uninstall script */
|
||||
if (!isset($data['isNotRunScriptAfter']) || !$data['isNotRunScriptAfter']) {
|
||||
if (!isset($data['skipAfterScript']) || !$data['skipAfterScript']) {
|
||||
$this->runScript('afterUninstall');
|
||||
}
|
||||
|
||||
|
||||
@@ -199,7 +199,8 @@ class Install extends \Espo\Core\Upgrades\Actions\Base\Install
|
||||
|
||||
$this->executeAction(ExtensionManager::UNINSTALL, array(
|
||||
'id' => $extensionEntity->get('id'),
|
||||
'isNotRunScriptAfter' => true,
|
||||
'skipSystemRebuild' => true,
|
||||
'skipAfterScript' => true,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user