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

Minimum required version for addons

Andy.N

Well-known member
#2
Would be useful if you could set a minimum required version for an addon, like if something required XenForo 1.1.0 or higher.
If something requires 1.0.4 does not mean it will work with 1.1.0, correct?
Then the author would either not support 1.0.4 when he updates his mods or make 2 versions?
 

Rigel Kentaurus

Well-known member
#3
If something requires 1.0.4 does not mean it will work with 1.1.0, correct?
Then the author would either not support 1.0.4 when he updates his mods or make 2 versions?
If something requires 1.0.4 then ideally you can install it from that version onwards, you can try and install that on 1.1.0 and if it works, great.
This is sort of a thing to do if the addon uses functionality that might not be present in previous versions.
 

Bob

Well-known member
#4
until they add a built in option, you can always do it this way in your installer...

1010033 is the versionID for 1.1.0 Beta3 for example...

PHP:
if (XenForo_Application::$versionId <= 1010033)
{
    throw new XenForo_Exception(new XenForo_Phrase('addon_requires_minimum_xenforo_version', array('version' => '1.1.0')));
}
Note: for those that don't know how to find things, you can find the current versionID /library/XenForo/Application.php (lines 22 and 23)
 

Mike

XenForo developer
Staff member
#5
until they add a built in option, you can always do it this way in your installer...
That's basically how I'd recommend doing it - your install code can check all sorts of things. In general, I don't think it's worth while to build a whole framework for these kind of checks when they're quite easy to do yourself.
 

digitalpoint

Well-known member
#6
Yep, agreed... not sure why it didn't occur to me to do the check myself (or anything else I need to check/manage) via the install method.

Been staring at far too much code lately. To bed!