@@ -0,0 +1,3202 @@
+package com.cedricziel.idea.typo3.util;%0A%0Aimport com.intellij.openapi.project.Project;%0Aimport com.intellij.psi.PsiElement;%0Aimport com.intellij.util.text.VersionComparatorUtil;%0Aimport com.jetbrains.php.PhpIndex;%0Aimport com.jetbrains.php.lang.psi.elements.Constant;%0Aimport com.jetbrains.php.lang.psi.elements.StringLiteralExpression;%0Aimport org.jetbrains.annotations.NotNull;%0Aimport org.jetbrains.annotations.Nullable;%0A%0Aimport java.util.Iterator;%0A%0Apublic class TYPO3Utility %7B%0A%0A    @Nullable%0A    public static Constant getVersionConstant(@NotNull Project project) %7B%0A        Iterator%3CConstant%3E typo3_version = PhpIndex%0A                .getInstance(project)%0A                .getConstantsByName(%22TYPO3_version%22)%0A                .iterator();%0A%0A        if (!typo3_version.hasNext()) %7B%0A            return null;%0A        %7D%0A%0A        return typo3_version.next();%0A    %7D%0A%0A    @Nullable%0A    public static Constant getBranchVersionConstant(@NotNull Project project) %7B%0A        Iterator%3CConstant%3E typo3_branch = PhpIndex%0A                .getInstance(project)%0A                .getConstantsByName(%22TYPO3_branch%22)%0A                .iterator();%0A%0A        if (!typo3_branch.hasNext()) %7B%0A            return null;%0A        %7D%0A%0A        return typo3_branch.next();%0A    %7D%0A%0A    @Nullable%0A    public static String getTYPO3Branch(@NotNull Project project) %7B%0A        Constant versionConstant = getBranchVersionConstant(project);%0A        if (versionConstant == null) %7B%0A            return null;%0A        %7D%0A%0A        PsiElement value = versionConstant.getValue();%0A        if (value instanceof StringLiteralExpression) %7B%0A            return ((StringLiteralExpression) value).getContents();%0A        %7D%0A%0A        return null;%0A    %7D%0A%0A    @Nullable%0A    public static String getTYPO3Version(@NotNull Project project) %7B%0A        Constant versionConstant = getVersionConstant(project);%0A        if (versionConstant == null) %7B%0A            return null;%0A        %7D%0A%0A        PsiElement value = versionConstant.getValue();%0A        if (value instanceof StringLiteralExpression) %7B%0A            return ((StringLiteralExpression) value).getContents();%0A        %7D%0A%0A        return null;%0A    %7D%0A%0A    /**%0A     * Examples: 1.0rc1 %3C 1.0release, 1.0 %3C 1.0.1, 1.1 %3E 1.02%0A     *%0A     * @return 0 if cms version equals given version, positive value if cms version %3E given version, negative value if cms version %3C given version%0A     */%0A    public static Integer compareVersion(@NotNull Project project, String version) %7B%0A        String typo3Version = getTYPO3Version(project);%0A%0A        return VersionComparatorUtil.compare(typo3Version, version);%0A    %7D%0A%0A    /**%0A     * Examples: 1.0rc1 %3C 1.0release, 1.0 %3C 1.0.1, 1.1 %3E 1.02%0A     *%0A     * @return 0 if cms version equals given version, positive value if cms version %3E given version, negative value if cms version %3C given version%0A     */%0A    public static Integer compareMajorMinorVersion(@NotNull Project project, String version) %7B%0A        String typo3Version = getTYPO3Branch(project);%0A%0A        return VersionComparatorUtil.compare(typo3Version, version);%0A    %7D%0A%0A    public static boolean isMajorMinorCmsVersion(@NotNull Project project, String version) %7B%0A        return compareMajorMinorVersion(project, version).equals(0);%0A    %7D%0A%7D%0A

Add TYPO3Utility and version related utility methods