XF 2.1 How to automate add-on installation

Arty

Well-known member
Is it possible to install add-on with few lines of code?

For example I have add-on variable:
Code:
$addOnManager = \XF::app()->addOnManager();
$addOn = $addOnManager->getById($this->_addOnId);
but then I don't see a way to install it.

$addOn is instance of XF/AddOn/AddOn class. I can see there is preInstall(), postDataImport() and postInstall() methods, but there are no functions for importing add-on's stuff.
 
I'm already in XenForo code, it doesn't make sense to spawn another XenForo instance.

It also runs full rebuild process, which might cause time out for my current XenForo session and things can go very wrong there. If possible I'd actually like to skip rebuild process entirely because what I'm trying to do is install another add-on during add-on's setup (like dependency installation), so there will be full rebuild after that anyway.
 
Back
Top Bottom