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

How would you check if an add-on is installed?

Discussion in 'XenForo Development Discussions' started by Jaxel, Feb 11, 2011.

  1. Jaxel

    Jaxel Well-Known Member

    Is there a preferred way to check to see if a forum has an add-on installed inside of a model?

    Right now I am doing the following:
    if (!XenForo_Application::autoload('EWRcarta_Model_Lists')) { return "kill"; }

    The problem however is that the class "EWRcarta_Model_Lists" can exist, and yet at the same time the forum could not have EWRcarta installed; but simply have the files uploaded to the server. So there has to be a better way...
  2. Jaxel

    Jaxel Well-Known Member

    this worked: but it adds a query
    if (!$addon = $this->getModelFromCache('XenForo_Model_AddOn')->getAddOnById('EWRporta')	|| !$addon['active'])
    	return "kill";

Share This Page