This action will be executed on the activation of the module

@access public
@param string $versionNumber
@param string $oldVersionNumber
439912
public function activate($versionNumber, $oldVersionNumber = '')
    {
        $runtimeManager = $this->framework->getRuntimeManager();
        
        $runtimeManager->addEventHandler('\\Zepi\\Installation\\ExecuteInstallation', '\\Zepi\\Web\\AccessControl\\EventHandler\\ExecuteInstallation', 100);
        $runtimeManager->addEventHandler('\\Zepi\\Core\\AccessControl\\Event\\DisplayNoAccessMessage', '\\Zepi\\Web\\AccessControl\\EventHandler\\DisplayNoAccessMessage');
        $runtimeManager->addEventHandler('\\Zepi\\Web\\AccessControl\\Event\\Registration', '\\Zepi\\Web\\AccessControl\\EventHandler\\Registration');
        $runtimeManager->addEventHandler('\\Zepi\\Web\\AccessControl\\Event\\Activation', '\\Zepi\\Web\\AccessControl\\EventHandler\\Activation');
        $runtimeManager->addEventHandler('\\Zepi\\Web\\AccessControl\\Event\\RequestNewPassword', '\\Zepi\\Web\\AccessControl\\EventHandler\\RequestNewPassword');
        $runtimeManager->addEventHandler('\\Zepi\\Web\\AccessControl\\Event\\GenerateNewPassword', '\\Zepi\\Web\\AccessControl\\EventHandler\\GenerateNewPassword');
        $runtimeManager->addEventHandler('\\Zepi\\Web\\AccessControl\\Event\\Login', '\\Zepi\\Web\\AccessControl\\EventHandler\\Login');
        $runtimeManager->addEventHandler('\\Zepi\\Web\\AccessControl\\Event\\Logout', '\\Zepi\\Web\\AccessControl\\EventHandler\\Logout');
        $runtimeManager->addEventHandler('\\Zepi\\Web\\AccessControl\\Event\\Profile', '\\Zepi\\Web\\AccessControl\\EventHandler\\Profile');
        $runtimeManager->addEventHandler('\\Zepi\\Web\\AccessControl\\Event\\ProfileChangePassword', '\\Zepi\\Web\\AccessControl\\EventHandler\\ProfileChangePassword');
        $runtimeManager->addEventHandler('\\Zepi\\Turbo\\Event\\BeforeExecution', '\\Zepi\\Web\\AccessControl\\EventHandler\\StartSession', 1);
        $runtimeManager->addEventHandler('\\Zepi\\Turbo\\Event\\BeforeExecution', '\\Zepi\\Web\\AccessControl\\EventHandler\\RegisterMenuEntries');
        
        // Administration
        $runtimeManager->addEventHandler('\\Zepi\\Web\\AccessControl\\Event\\Administration\\Users', '\\Zepi\\Web\\AccessControl\\EventHandler\\Administration\\Users');
        $runtimeManager->addEventHandler('\\Zepi\\Web\\AccessControl\\Event\\Administration\\EditUser', '\\Zepi\\Web\\AccessControl\\EventHandler\\Administration\\EditUser');
        $runtimeManager->addEventHandler('\\Zepi\\Web\\AccessControl\\Event\\Administration\\DeleteUser', '\\Zepi\\Web\\AccessControl\\EventHandler\\Administration\\DeleteUser');
        $runtimeManager->addEventHandler('\\Zepi\\Web\\AccessControl\\Event\\Administration\\Groups', '\\Zepi\\Web\\AccessControl\\EventHandler\\Administration\\Groups');
        $runtimeManager->addEventHandler('\\Zepi\\Web\\AccessControl\\Event\\Administration\\EditGroup', '\\Zepi\\Web\\AccessControl\\EventHandler\\Administration\\EditGroup');
        $runtimeManager->addEventHandler('\\Zepi\\Web\\AccessControl\\Event\\Administration\\DeleteGroup', '\\Zepi\\Web\\AccessControl\\EventHandler\\Administration\\DeleteGroup');
        
        
        // Add the permissions
        $eventAccessManager = $this->framework->getInstance('\\Zepi\\Core\\AccessControl\\Manager\\EventAccessManager');
        $eventAccessManager->addItem('\\Zepi\\Web\\AccessControl\\Event\\Profile', '\\Global\\Active');
        $eventAccessManager->addItem('\\Zepi\\Web\\AccessControl\\Event\\ProfileChangePassword', '\\Global\\Active');
        $eventAccessManager->addItem('\\Zepi\\Web\\AccessControl\\Event\\Logout', '\\Global\\Active');

        $eventAccessManager->addItem('\\Zepi\\Web\\AccessControl\\Event\\Administration\\Users', '\\Zepi\\Web\\AccessControl\\AccessLevel\\EditUsersAndGroups');
        $eventAccessManager->addItem('\\Zepi\\Web\\AccessControl\\Event\\Administration\\EditUser', '\\Zepi\\Web\\AccessControl\\AccessLevel\\EditUsersAndGroups');
        $eventAccessManager->addItem('\\Zepi\\Web\\AccessControl\\Event\\Administration\\DeleteUser', '\\Zepi\\Web\\AccessControl\\AccessLevel\\EditUsersAndGroups');
        $eventAccessManager->addItem('\\Zepi\\Web\\AccessControl\\Event\\Administration\\Groups', '\\Zepi\\Web\\AccessControl\\AccessLevel\\EditUsersAndGroups');
        $eventAccessManager->addItem('\\Zepi\\Web\\AccessControl\\Event\\Administration\\EditGroup', '\\Zepi\\Web\\AccessControl\\AccessLevel\\EditUsersAndGroups');
        $eventAccessManager->addItem('\\Zepi\\Web\\AccessControl\\Event\\Administration\\DeleteGroup', '\\Zepi\\Web\\AccessControl\\AccessLevel\\EditUsersAndGroups');
        
        
        // Filters
        $runtimeManager->addFilterHandler('\\Zepi\\Core\\AccessControl\\Filter\\PermissionsBackend\\ResolvePermissions', '\\Zepi\\Web\\AccessControl\\FilterHandler\\ResolveGroupPermissions');
        $runtimeManager->addFilterHandler('\\Zepi\\Core\\AccessControl\\Filter\\AccessLevelManager\\RegisterAccessLevels', '\\Zepi\\Web\\AccessControl\\FilterHandler\\RegisterGroupAccessLevels');
        
        
        
        // Public routes
        $routeManager = $this->framework->getRouteManager();
        $routeManager->addRoute('register', '\\Zepi\\Web\\AccessControl\\Event\\Registration');
        $routeManager->addRoute('activate|[s:uuid]|[s:token]', '\\Zepi\\Web\\AccessControl\\Event\\Activation');
        $routeManager->addRoute('request-new-password', '\\Zepi\\Web\\AccessControl\\Event\\RequestNewPassword');
        $routeManager->addRoute('generate-new-password|[s:uuid]|[s:token]', '\\Zepi\\Web\\AccessControl\\Event\\GenerateNewPassword');
        $routeManager->addRoute('login', '\\Zepi\\Web\\AccessControl\\Event\\Login');
        $routeManager->addRoute('logout', '\\Zepi\\Web\\AccessControl\\Event\\Logout');
        $routeManager->addRoute('profile', '\\Zepi\\Web\\AccessControl\\Event\\Profile');
        $routeManager->addRoute('profile|change-password', '\\Zepi\\Web\\AccessControl\\Event\\ProfileChangePassword');
        
        // Administration
        $routeManager->addRoute('administration|users', '\\Zepi\\Web\\AccessControl\\Event\\Administration\\Users');
        $routeManager->addRoute('administration|users|add', '\\Zepi\\Web\\AccessControl\\Event\\Administration\\EditUser');
        $routeManager->addRoute('administration|users|modify|[s:uuid]', '\\Zepi\\Web\\AccessControl\\Event\\Administration\\EditUser');
        $routeManager->addRoute('administration|users|delete|[s:uuid]', '\\Zepi\\Web\\AccessControl\\Event\\Administration\\DeleteUser');
        $routeManager->addRoute('administration|users|delete|[s:uuid]|[s:confirmation]', '\\Zepi\\Web\\AccessControl\\Event\\Administration\\DeleteUser');
        $routeManager->addRoute('administration|groups', '\\Zepi\\Web\\AccessControl\\Event\\Administration\\Groups');
        $routeManager->addRoute('administration|groups|add', '\\Zepi\\Web\\AccessControl\\Event\\Administration\\EditGroup');
        $routeManager->addRoute('administration|groups|modify|[s:uuid]', '\\Zepi\\Web\\AccessControl\\Event\\Administration\\EditGroup');
        $routeManager->addRoute('administration|groups|delete|[s:uuid]', '\\Zepi\\Web\\AccessControl\\Event\\Administration\\DeleteGroup');
        $routeManager->addRoute('administration|groups|delete|[s:uuid]|[s:confirmation]', '\\Zepi\\Web\\AccessControl\\Event\\Administration\\DeleteGroup');
        
        
        // Public templates
        $templatesManager = $this->framework->getInstance('\\Zepi\\Web\\General\\Manager\\TemplatesManager');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\NoAccessMessage', $this->directory . '/templates/NoAccessMessage.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\RegistrationForm', $this->directory . '/templates/Registration.Form.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\RegistrationFinished', $this->directory . '/templates/Registration.Finished.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\Activation', $this->directory . '/templates/Activation.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\RequestNewPasswordForm', $this->directory . '/templates/RequestNewPassword.Form.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\RequestNewPasswordFinished', $this->directory . '/templates/RequestNewPassword.Finished.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\GenerateNewPasswordFinished', $this->directory . '/templates/GenerateNewPassword.Finished.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\LoginForm', $this->directory . '/templates/Login.Form.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\Logout', $this->directory . '/templates/Logout.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\Profile', $this->directory . '/templates/Profile.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\ProfileChangePasswordForm', $this->directory . '/templates/ProfileChangePassword.Form.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\ProfileChangePasswordFinished', $this->directory . '/templates/ProfileChangePassword.Finished.phtml');
        
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Mail\\Registration', $this->directory . '/templates/Mail/Registration.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Mail\\RequestNewPassword', $this->directory . '/templates/Mail/RequestNewPassword.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Mail\\GenerateNewPassword', $this->directory . '/templates/Mail/GenerateNewPassword.phtml');
        
        // Administration
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\Administration\\Users', $this->directory . '/templates/Administration/Users.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\Administration\\EditUserForm', $this->directory . '/templates/Administration/EditUser.Form.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\Administration\\EditUserFinished', $this->directory . '/templates/Administration/EditUser.Finished.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\Administration\\DeleteUser', $this->directory . '/templates/Administration/DeleteUser.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\Administration\\DeleteUserFinished', $this->directory . '/templates/Administration/DeleteUser.Finished.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\Administration\\Groups', $this->directory . '/templates/Administration/Groups.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\Administration\\EditGroupForm', $this->directory . '/templates/Administration/EditGroup.Form.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\Administration\\EditGroupFinished', $this->directory . '/templates/Administration/EditGroup.Finished.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\Administration\\DeleteGroup', $this->directory . '/templates/Administration/DeleteGroup.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\Administration\\DeleteGroupFinished', $this->directory . '/templates/Administration/DeleteGroup.Finished.phtml');
        
        // Form
        $templatesManager->addTemplate('\\Zepi\\Web\\AccessControl\\Templates\\Form\\Snippet\\AccessLevel', $this->directory . '/templates/Form/Snippet/AccessLevel.phtml');
        
        // Access Levels
        $accessLevelsManager = $this->framework->getInstance('\\Zepi\\Core\\AccessControl\\Manager\\AccessLevelManager');
        $accessLevelsManager->addAccessLevel(new \Zepi\Core\AccessControl\Entity\AccessLevel(
            '\\Zepi\\Web\\AccessControl\\AccessLevel\\EditUsersAndGroups', 
            'Manage users and groups', 
            'Can create, modify and delete users and groups.', 
            '\\Zepi\\Web\\AccessControl'
        ));
        
        // Configuration
        $configurationManager = $this->framework->getInstance('\\Zepi\\Core\\Utils\\Manager\\ConfigurationManager');
        $configurationManager->addSettingIfNotSet('accesscontrol.allowRegistration', true);
        $configurationManager->addSettingIfNotSet('accesscontrol.allowRenewPassword', true);
        $configurationManager->saveConfigurationFile();
    }
45848
public function getOneVersion($versionNumber, $con = null)
    {
        return ChildDealerProductVersionQuery::create()
            ->filterByDealerProduct($this)
            ->filterByVersion($versionNumber)
            ->findOne($con);
    }
868631
private function evaluateVersionTarget(
        Target\Version $version,
        APILimitationValue $value
    ): ?bool {
        // intentionally evaluate all conditions separately from the least to the most important
        $accessVote = self::ACCESS_ABSTAIN;

        // allow creating new drafts
        if ($version->newStatus === VersionInfo::STATUS_DRAFT) {
            $accessVote = self::ACCESS_GRANTED;
        }

        // ... unless there's a specific list of target translations
        if (!empty($version->allLanguageCodesList)) {
            $accessVote = $this->evaluateMatchingAnyLimitation(
                $version->allLanguageCodesList,
                $value->limitationValues
            );
        }

        // ... or there's an intent to update Version
        if (!empty($version->forUpdateLanguageCodesList) || null !== $version->forUpdateInitialLanguageCode) {
            if (!empty($version->forUpdateLanguageCodesList)) {
                $diff = array_diff($version->forUpdateLanguageCodesList, $value->limitationValues);
                $accessVote = empty($diff) ? self::ACCESS_GRANTED : self::ACCESS_DENIED;
            }

            if ($accessVote !== self::ACCESS_DENIED && null !== $version->forUpdateInitialLanguageCode) {
                $accessVote = in_array(
                    $version->forUpdateInitialLanguageCode,
                    $value->limitationValues
                )
                    ? self::ACCESS_GRANTED
                    : self::ACCESS_DENIED;
            }
        }

        return $accessVote;
    }
279586
function setVersion(versionType, versionFull) {
        versionType.version = versionFull;
        var versionArray = versionFull.split(".");
        if (versionArray.length > 0) {
            versionArray = versionArray.reverse();
            versionType.major = versionArray.pop();
            if (versionArray.length > 0) {
                versionType.minor = versionArray.pop();
                if (versionArray.length > 0) {
                    versionArray = versionArray.reverse();
                    versionType.patch = versionArray.join(".");
                } else {
                    versionType.patch = "0";
                }
            } else {
                versionType.minor = "0";
            }
        } else {
            versionType.major = "0";
        }
    }
967197
public function activate($versionNumber, $oldVersionNumber = '')
    {
        $runtimeManager = $this->framework->getRuntimeManager();
        $runtimeManager->addEventHandler('\\Zepi\\Core\\Management\\Event\\RebuildFrameworkCache', '\\Zepi\\Core\\Management\\EventHandler\\RebuildFrameworkCache');
        $runtimeManager->addEventHandler('\\Zepi\\Core\\Management\\Event\\ListModules', '\\Zepi\\Core\\Management\\EventHandler\\ListModules');
        
        $routeManager = $this->framework->getRouteManager();
        $routeManager->addRoute('core|rebuildFrameworkCache', '\\Zepi\\Core\\Management\\Event\\RebuildFrameworkCache');
        $routeManager->addRoute('core|listModules', '\\Zepi\\Core\\Management\\Event\\ListModules');
    }
340964
public function revertTo(Model $Model, $versionId) {
		if (!$Model->id) {
			trigger_error('RevisionBehavior: Model::id must be set', E_USER_WARNING);
			return false;
		}
		if (!$Model->ShadowModel) {
			trigger_error('RevisionBehavior: ShadowModel doesnt exist.', E_USER_WARNING);
			return false;
		}
		$data = $Model->ShadowModel->find('first', array('conditions' => array('version_id' => $versionId)));
		if (!$data) {
			return false;
		}
		foreach ($Model->getAssociated('hasAndBelongsToMany') as $assocAlias) {
			if (isset($Model->ShadowModel->_schema[$assocAlias])) {
				$data[$assocAlias][$assocAlias] = explode(',', $data[$Model->alias][$assocAlias]);
			}
		}
		return (bool)$Model->save($data);
	}
372852
protected function createVersionLanding($versionDirectory)
    {
        $landingPath = $versionDirectory.'/'.config('larecipe.docs.landing').'.md';

        if (! $this->filesystem->exists($landingPath)) {
            $content = $this->generateLandingContent($this->getStub('landing'));
            $this->filesystem->put($landingPath, $content);

            return true;
        }

        return false;
    }
1141454
public function createNewVersionNode(NodeInterface $originalNode, $versionName = '')
    {
        $status = $this->statusRepository->findOneByInitial();

        /** @var NodeInterface $newNode */
        $newNode = clone $originalNode;
        $newNode->setStatus($status);
        $newNode->setVersion($this->uniqueIdGenerator->generateUniqueId());
        $this->duplicateArea($originalNode, $newNode);

        $newNode->setVersionName($versionName);
        if (empty($versionName)) {
            $newNode = $this->setVersionName($newNode);
        }


        return $newNode;
    }
547702
public function getOneVersion($versionNumber, $con = null)
    {
        return ChildSkillVersionQuery::create()
            ->filterBySkill($this)
            ->filterByVersion($versionNumber)
            ->findOne($con);
    }
1183061
protected function initializeCommittedVersion(int $committedVersion): void
    {
        if (!$this->eventCollection()->isEmpty()) {
            $message = 'Cannot initialize version after recording events';
            throw new OperationException($message);
        }

        $this->eventCollection()->initializeSequence($committedVersion);
    }
1033272
@Override
    public R visitVersion(VersionTree node, P p) {
        return defaultAction(node, p);
    }
1153577
public function addVersionOfFile(File $origFile, File $newFile, $version = null)
    {
        if(!$this->containsFile($origFile)){
            return null;
        }

        $name = $this->versionFileName($origFile, $version);

        $f = new FileImpl($origFile->getParentFolder()->getAbsolutePath()."/".$name);
        if($f->exists()){
            return $f;
        }

        return $this->addToLibraryHelper($origFile->getParentFolder(),$newFile, $name);
    }
511349
public function deleteTranslationFromVersionFields(VersionInfo $versionInfo, $languageCode)
    {
        $fieldTypeIdsMap = $this->contentGateway->getFieldIdsByType(
            $versionInfo->contentInfo->id,
            $versionInfo->versionNo,
            $languageCode
        );
        foreach ($fieldTypeIdsMap as $fieldType => $ids) {
            $this->storageHandler->deleteFieldData($fieldType, $versionInfo, $ids);
        }
        $this->contentGateway->deleteTranslatedFields(
            $languageCode,
            $versionInfo->contentInfo->id,
            $versionInfo->versionNo
        );
    }
126685
protected function registerSupportedVersions(VersionControl $version): void
    {
        foreach ($this->versions as $code => $namespace) {
            $version->addVersion($code, $namespace);
        }

        if (! is_null($this->defaultVersion)) {
            $version->setDefaultVersion($this->defaultVersion);
        }
    }
1057058
public function activate($versionNumber, $oldVersionNumber = '')
    {
        $configurationManager = $this->framework->getInstance('\\Zepi\\Core\\Utils\\Manager\\ConfigurationManager');
        $configurationManager->addSettingIfNotSet('doctrine.databaseDriver', 'pdo_mysql');
        $configurationManager->addSettingIfNotSet('doctrine.databaseHost', 'localhost');
        $configurationManager->addSettingIfNotSet('doctrine.databaseName', '');
        $configurationManager->addSettingIfNotSet('doctrine.databaseUser', '');
        $configurationManager->addSettingIfNotSet('doctrine.databasePassword', '');
        $configurationManager->saveConfigurationFile();
        
        $runtimeManager = $this->framework->getRuntimeManager();
        $runtimeManager->addEventHandler('\\Zepi\\Installation\\ExecuteInstallation', '\\Zepi\\DataSource\\Doctrine\\EventHandler\\ExecuteInstallation', 51);
    }
201783
public function migrate($version = null)
    {
        $migrations     = $this->getMigrations();
        $versions       = $this->getVersions();
        $currentVersion = $this->getCurrentVersion();

        if (!count($migrations)) {
            throw new \RuntimeException('No migrations found.');
        }

        if ($version === null) {
            $version = max(array_merge($versions, array_keys(iterator_to_array($migrations))));
        } else {
            if ($version != 0 && empty($migrations[$version])) {
                throw new \RuntimeException('Version is not valid.');
            }
        }

        // Prepare SQL logs
        if (is_file($this->getLogFile())) {
            File::delete($this->getLogFile());
        }

        Folder::create(dirname($this->getLogFile()));

        $queryLogStream = new Stream($this->getLogFile(), Stream::MODE_WRITE_ONLY_FROM_END);
        $logListener = function (Event $event) use ($queryLogStream) {
            $queryLogStream->write($event['query'] . ";\n\n");
        };
        Ioc::getDispatcher()->listen('onMigrationAfterQuery', $logListener);

        $direction = ($version > $currentVersion) ? AbstractMigration::UP : AbstractMigration::DOWN;

        $migrations = iterator_to_array($migrations);

        $count = 0;

        try {
            if ($direction === AbstractMigration::DOWN) {
                krsort($migrations);

                foreach ($migrations as $migration) {
                    if ($migration['version'] <= $version) {
                        break;
                    }

                    if (in_array($migration['version'], $versions)) {
                        $this->executeMigration($migration, AbstractMigration::DOWN);
                    }

                    $count++;
                }
            }

            ksort($migrations);

            foreach ($migrations as $migration) {
                if ($migration['version'] > $version) {
                    break;
                }

                if (!in_array($migration['version'], $versions, true)) {
                    $this->executeMigration($migration, AbstractMigration::UP);
                }

                $count++;
            }
        } catch (\PDOException $e) {
            $queryLogStream->write("-- ERROR: {$e->getMessage()}\n" . $this->db->getQuery());

            throw $e;
        }

        Ioc::getDispatcher()->removeListener($logListener);

        if (!$count) {
            $this->out('No change.');
        }
    }
956468
public function getOneVersion($versionNumber, $con = null)
    {
        return ChildDealerContactInfoVersionQuery::create()
            ->filterByDealerContactInfo($this)
            ->filterByVersion($versionNumber)
            ->findOne($con);
    }