1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

List of all Application IDs of XenForo to date?

Discussion in 'XenForo Development Discussions' started by Robust, Nov 22, 2015.

  1. Robust

    Robust Well-Known Member

    Do you have a list of all XF versions and its ids (so $version and $versionId) from XenForo to date? I'm working on a 'core' (if you like) to reduce boilerplate in my add-ons. I'm thinking of storing XF's versions and then my add-on can pick which ones it is and isn't compatible with, so is there a list? There might be a more efficient way of doing it, if you know.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    The XF versioning takes the form ABBCCXY, where:
    A = major version
    BB = second point
    CC = minor version
    X = status
    Y = version

    With X being:
    1 = alpha
    3 = beta
    5 = release candidate
    7 = stable

    So examples would be:
    1.0.4 Beta 4 = 1000434
    1.3.0 RC 2 = 1030052
    1.4.2 = 1040270
    1.5.0 Alpha 1 = 1050011
    1.5.2 = 1050270
    Kevin, Steve F and Robust like this.
  3. Robust

    Robust Well-Known Member

    Thanks Brogan!
  4. Brogan

    Brogan XenForo Moderator Staff Member

    I should add that in most cases, all you probably need to do is define a minimum version.

    So in Install.php, you would have something like:

    class CTA_Criteria_Install
        public static function 
            if (
    XenForo_Application::$versionId 1020070)
                throw new 
    XenForo_Exception('This add-on requires XenForo 1.2.0 or newer.'true);
    Robust likes this.
  5. Robust

    Robust Well-Known Member

    Yeah, that's the approach I ended up taking:

            if(\XenForo_Application::$version < $application->minimumXfVersion)
                throw new \XenForo_Exception('Your XF version does not meet the minimum requirements for this add-on. Minimum XF version ID: ' . $application->minimumXfVersion, true);
    I did realise a bunch of problems. I initialise a new instance of Application which handles all of the tasks in the Core, since the Core add-on can be used by multiple add-ons that depend on it. What I realised later is I can't really store the object (I mean, storing it would be dumb), reinitialising it every time is also pretty dumb, so really, I'm a bit lost at this point. I'll figure it out though, I suppose. The Application stores all the info about the add-on which the rest of the helpers/functions rely on.

Share This Page