application/Espo/Core/Upgrades/Actions/Base.php
protected function runScript($type)
    {
        $packagePath = $this->getPackagePath();
        $scriptNames = $this->getParams('scriptNames');

        $scriptName = $scriptNames[$type];
        if (!isset($scriptName)) {
            return;
        }

        $beforeInstallScript = Util::concatPath( array($packagePath, self::SCRIPTS, $scriptName) ) . '.php';

        if (file_exists($beforeInstallScript)) {
            require_once($beforeInstallScript);
            $script = new $scriptName();

            try {
                $script->run($this->getContainer(), $this->scriptParams);
            } catch (\Exception $e) {
                $this->throwErrorAndRemovePackage($e->getMessage());
            }
        }
    }
protected function runScript($type)
    {
        $packagePath = $this->getPackagePath();
        $scriptNames = $this->getParams('scriptNames');

        $scriptName = $scriptNames[$type];
        if (!isset($scriptName)) {
            return;
        }

        $beforeInstallScript = Util::concatPath( array($packagePath, self::SCRIPTS, $scriptName) ) . '.php';

        if (file_exists($beforeInstallScript)) {
            require_once($beforeInstallScript);
            $script = new $scriptName();

            try {
                $script->run($this->getContainer(), $this->scriptParams);
            } catch (\Exception $e) {
                $this->throwErrorAndRemovePackage($e->getMessage());
            }
        }
    }
protected function runScript ( $ type ) { $ packagePath = $ this -> getPackagePath ( ) ; $ scriptNames = $ this -> getParams ( 'scriptNames' ) ; $ scriptName = $ scriptNames [ $ type ] ; if ( ! isset ( $ scriptName ) ) { return ; } $ beforeInstallScript = Util :: concatPath ( array ( $ packagePath , self :: SCRIPTS , $ scriptName ) ) . '.php' ; if ( file_exists ( $ beforeInstallScript ) ) { require_once ( $ beforeInstallScript ) ; $ script = new $ scriptName ( ) ; try { $ script -> run ( $ this -> getContainer ( ) , $ this -> scriptParams ) ; } catch ( \ Exception $ e ) { $ this -> throwErrorAndRemovePackage ( $ e -> getMessage ( ) ) ; } } }
Run scripts by type
@param  string $type Ex. "before", "after"
@return void
Run scripts by type