Upgrades: impoved beforeRunAction(), afterRunAction()
This commit is contained in:
@@ -66,11 +66,11 @@ class Install extends \Espo\Core\Upgrades\Actions\Base
|
||||
|
||||
$this->backupExistingFiles();
|
||||
|
||||
$this->beforeRunAction();
|
||||
|
||||
/* run before install script */
|
||||
$this->runScript('before');
|
||||
|
||||
$this->beforeRunAction();
|
||||
|
||||
/* copy files from directory "Files" to EspoCRM files */
|
||||
if (!$this->copyFiles()) {
|
||||
$this->throwErrorAndRemovePackage('Cannot copy files.');
|
||||
@@ -84,11 +84,11 @@ class Install extends \Espo\Core\Upgrades\Actions\Base
|
||||
$this->throwErrorAndRemovePackage('Error occurred while EspoCRM rebuild.');
|
||||
}
|
||||
|
||||
$this->afterRunAction();
|
||||
|
||||
/* run before install script */
|
||||
$this->runScript('after');
|
||||
|
||||
$this->afterRunAction();
|
||||
|
||||
$this->clearCache();
|
||||
|
||||
/* delete unziped files */
|
||||
|
||||
@@ -41,11 +41,11 @@ class Uninstall extends \Espo\Core\Upgrades\Actions\Base
|
||||
|
||||
$this->checkIsWritable();
|
||||
|
||||
$this->beforeRunAction();
|
||||
|
||||
/* run before install script */
|
||||
$this->runScript('beforeUninstall');
|
||||
|
||||
$this->beforeRunAction();
|
||||
|
||||
$backupPath = $this->getPath('backupPath');
|
||||
if (file_exists($backupPath)) {
|
||||
|
||||
@@ -64,11 +64,11 @@ class Uninstall extends \Espo\Core\Upgrades\Actions\Base
|
||||
throw new $this->throwErrorAndRemovePackage('Error occurred while EspoCRM rebuild.');
|
||||
}
|
||||
|
||||
$this->afterRunAction();
|
||||
|
||||
/* run before install script */
|
||||
$this->runScript('afterUninstall');
|
||||
|
||||
$this->afterRunAction();
|
||||
|
||||
$this->clearCache();
|
||||
|
||||
/* delete backup files */
|
||||
|
||||
@@ -40,6 +40,8 @@ class Upload extends \Espo\Core\Upgrades\Actions\Base
|
||||
|
||||
$this->initialize();
|
||||
|
||||
$this->beforeRunAction();
|
||||
|
||||
$packagePath = $this->getPackagePath();
|
||||
$packageArchivePath = $this->getPackagePath(true);
|
||||
|
||||
@@ -57,6 +59,8 @@ class Upload extends \Espo\Core\Upgrades\Actions\Base
|
||||
|
||||
$this->isAcceptable();
|
||||
|
||||
$this->afterRunAction();
|
||||
|
||||
$this->finalize();
|
||||
|
||||
$GLOBALS['log']->debug('Installation process ['.$processId.']: end upload the package.');
|
||||
|
||||
Reference in New Issue
Block a user