Addon Development Setup
Everytime I want to test an addon that I'm working on, if I've removed/added new hooks, I find I have to uninstall the previous iteration of my package and then re-install the latest build I'm working on just to test the changes.
How does everyone else handle this? Does anyone use scripts to re-integrate all the hooks from a newly-updated addon? Am I just missing something obvioius to make this easier?
Re: Addon Development Setup
Reply #2 –
Vagrant. Just create a new VM for every addon you are working on. Doesn't take any more space on your drive and you can test anything any time.
Re: Addon Development Setup
Reply #4 –
Ah, I totally misunderstood the question. Use Vagrant to handle the issue of uninstallation and having a clean install. Then, after you do the install of SMF, do a query to add the hook.
Re: Addon Development Setup
Reply #6 –
If we had an "addons" directory in the boarddir, then inside this, a directory for each addon, where the package .zip would be extracted to. In the root of addons/<addon subdir> would lie a directory structure identical to Elk's own. Methods such as the action dispatcher could then use addons/*/sources/controllers as a search path along with sources/controllers.
Re: Addon Development Setup
Reply #9 –
Could you point me to the relevant branch and commits for this pluggable addon loading please? I'll see what I can do to flesh it out.
Re: Addon Development Setup
Reply #11 –
So, it's mostly there as far as I can tell, right? We need the autoloader to understand where to look for classes under addon namespaces. Hooks.class.php loads all the integration hooks from $modSettings['autoload_integrate'] for addons, so I assume that we just need to populate $modSettings['autoload_integrate'] when installing an addon, and that takes care of the integration hooks, which in turn call fully qualified (or not, if the integration files are namespaced too) class names, which the autoloader understands. Am I missing anything?
Re: Addon Development Setup
Reply #13 –
Okay, all sounds good.
Oh I did miss something, we also need to make the dispatcher object-oriented so that it's calling methods for the autoloader to deal with instead of defining files from the sources/controllers directory in the actions array.
I'm going to go ahead and fork the branch and try to get all this working. I desperately need it for the addons I'm working on.