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


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


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