source/Core/Module/ModuleInstaller.php
public function activate(\OxidEsales\Eshop\Core\Module\Module $module)
    {
        $result = false;
        if ($moduleId = $module->getId()) {
            $this->_addExtensions($module);
            $this->_removeFromDisabledList($moduleId);

            if (version_compare($module->getMetaDataVersion(), '2.0', '<')) {
                /** Support for the key 'files' was removed in MetaData version 2.0 */
                $this->_addModuleFiles($module->getInfo("files"), $moduleId);
            }

            $this->_addTemplateBlocks($module->getInfo("blocks"), $moduleId);
            $this->_addTemplateFiles($module->getInfo("templates"), $moduleId);
            $settingsHandler = oxNew(SettingsHandler::class);
            $settingsHandler->setModuleType('module')->run($module);
            $this->_addModuleVersion($module->getInfo("version"), $moduleId);
            $this->_addModuleExtensions($module->getExtensions(), $moduleId);
            $this->_addModuleEvents($module->getInfo("events"), $moduleId);

            if (version_compare($module->getMetaDataVersion(), '2.0', '>=')) {
                try {
                    /** Support for the key 'controllers' was added in MetaData version 2.0 */
                    $this->addModuleControllers($module->getControllers(), $moduleId);
                } catch (ModuleValidationException $exception) {
                    $this->deactivate($module);
                    $lang = Registry::getLang();
                    $message = sprintf($lang->translateString('ERROR_METADATA_CONTROLLERS_NOT_UNIQUE', null, true), $exception->getMessage());

                    $standardException = oxNew(StandardException::class);
                    $standardException->setMessage($message);

                    throw $standardException;
                }
            }

            if (version_compare($module->getMetaDataVersion(), '2.1', '>=')) {
                try {
                    $this->addModuleSmartyPluginDirectories($module);
                } catch (\Exception $exception) {
                    $this->deactivate($module);

                    throw oxNew(StandardException::class, $exception->getMessage());
                }
            }

            $this->activateShopAwareServices($module);

            $this->resetCache();

            $this->_callEvent('onActivate', $moduleId);

            $result = true;
        }

        return $result;
    }
public function activate(\OxidEsales\Eshop\Core\Module\Module $module)
    {
        $result = false;
        if ($moduleId = $module->getId()) {
            $this->_addExtensions($module);
            $this->_removeFromDisabledList($moduleId);

            if (version_compare($module->getMetaDataVersion(), '2.0', '<')) {
                /** Support for the key 'files' was removed in MetaData version 2.0 */
                $this->_addModuleFiles($module->getInfo("files"), $moduleId);
            }

            $this->_addTemplateBlocks($module->getInfo("blocks"), $moduleId);
            $this->_addTemplateFiles($module->getInfo("templates"), $moduleId);
            $settingsHandler = oxNew(SettingsHandler::class);
            $settingsHandler->setModuleType('module')->run($module);
            $this->_addModuleVersion($module->getInfo("version"), $moduleId);
            $this->_addModuleExtensions($module->getExtensions(), $moduleId);
            $this->_addModuleEvents($module->getInfo("events"), $moduleId);

            if (version_compare($module->getMetaDataVersion(), '2.0', '>=')) {
                try {
                    /** Support for the key 'controllers' was added in MetaData version 2.0 */
                    $this->addModuleControllers($module->getControllers(), $moduleId);
                } catch (ModuleValidationException $exception) {
                    $this->deactivate($module);
                    $lang = Registry::getLang();
                    $message = sprintf($lang->translateString('ERROR_METADATA_CONTROLLERS_NOT_UNIQUE', null, true), $exception->getMessage());

                    $standardException = oxNew(StandardException::class);
                    $standardException->setMessage($message);

                    throw $standardException;
                }
            }

            if (version_compare($module->getMetaDataVersion(), '2.1', '>=')) {
                try {
                    $this->addModuleSmartyPluginDirectories($module);
                } catch (\Exception $exception) {
                    $this->deactivate($module);

                    throw oxNew(StandardException::class, $exception->getMessage());
                }
            }

            $this->activateShopAwareServices($module);

            $this->resetCache();

            $this->_callEvent('onActivate', $moduleId);

            $result = true;
        }

        return $result;
    }
public function activate ( \ OxidEsales \ Eshop \ Core \ Module \ Module $ module ) { $ result = false ; if ( $ moduleId = $ module -> getId ( ) ) { $ this -> _addExtensions ( $ module ) ; $ this -> _removeFromDisabledList ( $ moduleId ) ; if ( version_compare ( $ module -> getMetaDataVersion ( ) , '2.0' , '<' ) ) { /** Support for the key 'files' was removed in MetaData version 2.0 */ $ this -> _addModuleFiles ( $ module -> getInfo ( "files" ) , $ moduleId ) ; } $ this -> _addTemplateBlocks ( $ module -> getInfo ( "blocks" ) , $ moduleId ) ; $ this -> _addTemplateFiles ( $ module -> getInfo ( "templates" ) , $ moduleId ) ; $ settingsHandler = oxNew ( SettingsHandler :: class ) ; $ settingsHandler -> setModuleType ( 'module' ) -> run ( $ module ) ; $ this -> _addModuleVersion ( $ module -> getInfo ( "version" ) , $ moduleId ) ; $ this -> _addModuleExtensions ( $ module -> getExtensions ( ) , $ moduleId ) ; $ this -> _addModuleEvents ( $ module -> getInfo ( "events" ) , $ moduleId ) ; if ( version_compare ( $ module -> getMetaDataVersion ( ) , '2.0' , '>=' ) ) { try { /** Support for the key 'controllers' was added in MetaData version 2.0 */ $ this -> addModuleControllers ( $ module -> getControllers ( ) , $ moduleId ) ; } catch ( ModuleValidationException $ exception ) { $ this -> deactivate ( $ module ) ; $ lang = Registry :: getLang ( ) ; $ message = sprintf ( $ lang -> translateString ( 'ERROR_METADATA_CONTROLLERS_NOT_UNIQUE' , null , true ) , $ exception -> getMessage ( ) ) ; $ standardException = oxNew ( StandardException :: class ) ; $ standardException -> setMessage ( $ message ) ; throw $ standardException ; } } if ( version_compare ( $ module -> getMetaDataVersion ( ) , '2.1' , '>=' ) ) { try { $ this -> addModuleSmartyPluginDirectories ( $ module ) ; } catch ( \ Exception $ exception ) { $ this -> deactivate ( $ module ) ; throw oxNew ( StandardException :: class , $ exception -> getMessage ( ) ) ; } } $ this -> activateShopAwareServices ( $ module ) ; $ this -> resetCache ( ) ; $ this -> _callEvent ( 'onActivate' , $ moduleId ) ; $ result = true ; } return $ result ; }
Activate extension by merging module class inheritance information with shop module array

@param \OxidEsales\Eshop\Core\Module\Module $module

@return bool
Activate extension by merging module class inheritance information with shop module array