Core/ModuleStateFixer.php
private function restoreModuleInformation($module, $moduleId)
    {
        $active = $this->isActive($moduleId);

        $this->fixExtensions($module);
        $metaDataVersion = $module->getMetaDataVersion();
        $metaDataVersion = $metaDataVersion == '' ? $metaDataVersion = "1.0" : $metaDataVersion;
        if (version_compare($metaDataVersion, '2.0', '<')) {
            $this->_addModuleFiles($active ? $module->getInfo("files") : [], $moduleId);
        }
        $this->_addTemplateBlocks($active ? $module->getInfo("blocks") : [], $moduleId);
        $this->_addTemplateFiles($active ? $module->getInfo("templates"): [], $moduleId);
        $this->_addModuleSettings($module->getInfo("settings"), $moduleId);
        $this->_addModuleVersion($active ? $module->getInfo("version") : null, $moduleId);

        $this->_addModuleEvents($active ? $module->getInfo("events") : [], $moduleId);

        if (version_compare($metaDataVersion, '2.0', '>=')) {
            try {
                $moduleControllers = $active ? $module->getControllers() : [];
                $this->setModuleControllers($moduleControllers, $moduleId, $module);
            } catch (ModuleValidationException $exception) {
                print "[ERROR]: duplicate controllers:" . $exception->getMessage() ."\n";
            }
        }
    }
private function restoreModuleInformation($module, $moduleId)
    {
        $active = $this->isActive($moduleId);

        $this->fixExtensions($module);
        $metaDataVersion = $module->getMetaDataVersion();
        $metaDataVersion = $metaDataVersion == '' ? $metaDataVersion = "1.0" : $metaDataVersion;
        if (version_compare($metaDataVersion, '2.0', '<')) {
            $this->_addModuleFiles($active ? $module->getInfo("files") : [], $moduleId);
        }
        $this->_addTemplateBlocks($active ? $module->getInfo("blocks") : [], $moduleId);
        $this->_addTemplateFiles($active ? $module->getInfo("templates"): [], $moduleId);
        $this->_addModuleSettings($module->getInfo("settings"), $moduleId);
        $this->_addModuleVersion($active ? $module->getInfo("version") : null, $moduleId);

        $this->_addModuleEvents($active ? $module->getInfo("events") : [], $moduleId);

        if (version_compare($metaDataVersion, '2.0', '>=')) {
            try {
                $moduleControllers = $active ? $module->getControllers() : [];
                $this->setModuleControllers($moduleControllers, $moduleId, $module);
            } catch (ModuleValidationException $exception) {
                print "[ERROR]: duplicate controllers:" . $exception->getMessage() ."\n";
            }
        }
    }
Code taken from OxidEsales\EshopCommunity\Core\Module::activate

@param Module $module
@param string $moduleId

@throws \OxidEsales\Eshop\Core\Exception\StandardException