Gobb
Member
Hey guys,
Just a query regarding how addon version checking is handled in the setup.php file for XenForo 2? I'm in the process of re-writing addons for the eventual move from 1.5 -> 2.2, but can't find much info as to how to actually update XF2 addons. What I mean is, in XF1, we could just add the $addon variable to the install function and then check the addon id with that to perform any updates. How is this done in XenForo 2? I assume using StepRunnerUpgradeTrait and the upgrade function, but I'm just a bit confused how I actually check the addon id within that function. When trying with the below, the base install function still seems to run and I get errors, obviously because the tables or columns added already exist... 1100010 is the addon version id from the addon.json file, I think this is correct?
I don't really have anything to put within that upgrade function itself as I am not intending to make any changes to existing 1.5 addon tables at this point in time. Should the install function just not add any tables or modifications if they already exist from the 1.5 addon?
Any help would be much appreciated,
Thanks.
Just a query regarding how addon version checking is handled in the setup.php file for XenForo 2? I'm in the process of re-writing addons for the eventual move from 1.5 -> 2.2, but can't find much info as to how to actually update XF2 addons. What I mean is, in XF1, we could just add the $addon variable to the install function and then check the addon id with that to perform any updates. How is this done in XenForo 2? I assume using StepRunnerUpgradeTrait and the upgrade function, but I'm just a bit confused how I actually check the addon id within that function. When trying with the below, the base install function still seems to run and I get errors, obviously because the tables or columns added already exist... 1100010 is the addon version id from the addon.json file, I think this is correct?
PHP:
public function upgrade1100010Step1(array $stepParams) {
}
I don't really have anything to put within that upgrade function itself as I am not intending to make any changes to existing 1.5 addon tables at this point in time. Should the install function just not add any tables or modifications if they already exist from the 1.5 addon?
Any help would be much appreciated,
Thanks.