• 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?

Robust

Well-known member
#1
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.
 

Brogan

XenForo moderator
Staff member
#2
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
 

Robust

Well-known member
#3
The XF versioning takes the form ABBCCXY, where:
A = major version
BB = second point
C C= 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
Thanks Brogan!
 

Brogan

XenForo moderator
Staff member
#4
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:
PHP:
<?php

class CTA_Criteria_Install
{
    public static function install($installedAddon)
    {
        if (XenForo_Application::$versionId < 1020070)
        {
            throw new XenForo_Exception('This add-on requires XenForo 1.2.0 or newer.', true);
        }
    }
}
 

Robust

Well-known member
#5
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:
PHP:
<?php

class CTA_Criteria_Install
{
    public static function install($installedAddon)
    {
        if (XenForo_Application::$versionId < 1020070)
        {
            throw new XenForo_Exception('This add-on requires XenForo 1.2.0 or newer.', true);
        }
    }
}
Yeah, that's the approach I ended up taking:

Code:
    {
        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.