Not too sure we'll ever really support extensions during the install process because of the risk of something bricking an install
It is possible to run extension code during upgrade / install (by adding code event listeners or even class extensions in some cases via
config.php
), but setting this up is rather complicated and not possible for XenForo cloud users.
It is also possible to run an install / upgrade with modified files (will trigger a warning though).
In both cases modified / 3rd party code could run during install / upgrade.
I totally understand the reasoning behind not allowing Add-on code to be executed during upgrade / install, but as pointed out by
@Xon and
@digitalpoint this can be a major PITA in some edge cases.
A code event that is only fired on install / upgrade bootstrap would be pretty useful for such cases.
To guard against bricking the process due to broken / incompatible code this could be protected with "big red warning" confirmation, eg. a bit like the warning about modified files:
The admin would have to confirm that attached listeners should be executed - if not the process continues without calling the listeners.
IMHO this would be the "best of both worlds" - it can (to a big extend) protect XenForo upgrades from breaking due to bad code and can help Add-ons from breaking due to code that was not run during XenForo upgrades.
At least a code event (or job) that is fired once after an upgrade really should be added, that would simplify quite a few things for my Add-ons.
I initially also thought about checking the version ID but tossed that idea as being kinda ugly
Maybe it would be possible to enqueue an empty job (
XF:UpgradeCompleted
or smth. like this) that basically does nothing (except maybe firing a code event) at the end of
XF\Upgrade::completeUpgrade()
?
This could act as a trigger and would run outside the upgrade processes but would ensure it does get run after an upgrade and does not require "active wating" for a version ID change.[/icode]