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

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:
Code:
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...
 
this worked: but it adds a query
Code:
if (!$addon = $this->getModelFromCache('XenForo_Model_AddOn')->getAddOnById('EWRporta')	|| !$addon['active'])
{
	return "kill";
}
 
Top Bottom