Abbruch Modulinstallation

Hallo Community,

ich habe ein Modul mit onActivate und onDeactivate Events.

Sollte jetzt bei der Aktivierungsprozedur etwas schief laufen, will ich, dass das Modul garnicht erst aktiviert wird.

Habe es mit einer Exception versucht, dann bekomme ich aber einfach nur “Shop Offline!” und das Modul wird trotzdem aktiviert… Gibt es eine Möglichkeit, das zu unterbinden?

nein, onActivation Event wird erst nach dem Aktivieren ausgelöst.
http://docu.oxid-esales.com/CE/sourcecodedocumentation/4.9.7/oxmoduleinstaller_8php_source.html#l00054

Alles klar, hab mir jetzt einfach eine abort Funktion gebaut:


    /**
     * Aborts installation, deactivates module.
     * If an error occurs, adds it to the display
     *
     * @return void
     */
    private static function _abort()
    {
        try {
            $oModule = oxNew('oxmodule');
            $oModule->load( self::MODULE_ID );

            oxRegistry::get( 'oxModuleInstaller' )->deactivate( $oModule );
        } catch( Exception $oEx ) {
            oxRegistry::get( 'oxUtilsView' )->addErrorToDisplay( $oEx );
        }
    }