diff --git a/application/Espo/Core/Upgrades/Actions/Base/Install.php b/application/Espo/Core/Upgrades/Actions/Base/Install.php index b3cc3dd1fe..10b6bd46a4 100644 --- a/application/Espo/Core/Upgrades/Actions/Base/Install.php +++ b/application/Espo/Core/Upgrades/Actions/Base/Install.php @@ -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(); diff --git a/application/Espo/Core/Upgrades/Actions/Base/Uninstall.php b/application/Espo/Core/Upgrades/Actions/Base/Uninstall.php index f1d49a2125..a1d50325ba 100644 --- a/application/Espo/Core/Upgrades/Actions/Base/Uninstall.php +++ b/application/Espo/Core/Upgrades/Actions/Base/Uninstall.php @@ -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'); } diff --git a/application/Espo/Core/Upgrades/Actions/Extension/Install.php b/application/Espo/Core/Upgrades/Actions/Extension/Install.php index 202292f94a..00ad0a9004 100644 --- a/application/Espo/Core/Upgrades/Actions/Extension/Install.php +++ b/application/Espo/Core/Upgrades/Actions/Extension/Install.php @@ -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, ) ); }