1. 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

Discussion in 'XenForo Suggestions' started by digitalpoint, Oct 26, 2011.

  1. digitalpoint

    digitalpoint Well-Known Member

    Would be useful if you could set a minimum required version for an addon, like if something required XenForo 1.1.0 or higher.
     
    Jeremy, Fuhrmann, danswano and 2 others like this.
  2. Andy.N

    Andy.N Well-Known Member

    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?
     
  3. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    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.
     
  4. Bob

    Bob Well-Known Member

    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)
     
    SchmitzIT, digitalpoint and Floris like this.
  5. Mike

    Mike XenForo Developer Staff Member

    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.
     
  6. digitalpoint

    digitalpoint Well-Known Member

    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!
     

Share This Page