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

Addon Prerequisites?

Discussion in 'XenForo Development Discussions' started by Jaxel, Sep 25, 2011.

  1. Jaxel

    Jaxel Well-Known Member

    I am making a "Base Framework" addon for all my mods. If you want to install any of my mods, you will be required to have this addon installed.

    How would I set up an addon so that it checks to see if addon_id "EWRbase", version_id "1" is installed?
  2. bambua

    bambua Well-Known Member

    It's not from the core of Zend/XF but couldn't you check to see if the class exists that is from your addon? before it tries to execute anything.
  3. ragtek

    ragtek Guest

    1. way => check in the installer, if a class of your framework exists & is loadable
    2. way (cleaner)
    $addOnModel XenForo_Model::create('XenForo_Model_AddOn');
    $fwVersion $addOnModel->getAddOnVersion('yourframework');

            if (!
    $fwVersion) {
            else {
                if (
    $fwVersion['version_id'] < self::FW_REQUIRED_VERSION) {
                    throw new 
    XenForo_Exception('new framework version > ' self::FW_REQUIRED_VERSION ' required'true);
    bambua likes this.

Share This Page