My component hooks into some core Joomla behaviour, adding an extra path that it needs other related components to be able to use. I do this simply by adding it to the global path include ( defines.php
) on install and removing it on uninstall.
This works well, although I accept that it may be bad policy. I need this path to be available globally and the current approach achieves that.
The problem is that if Joomla updates there is potential for my path to be erased if the update overwrites that file. I have seen this happen and it obviously makes a mess of my other components.
Having the path available is far tidier and more readable than using a component path globally, especially as some of the code that requires it may not be part of a component at all, so I would prefer to keep it this way. What I am looking for is a way to maintain this configuration across updates.
Is there a way to either keep the configured path somewhere that it will always be available but Joomla will not remove it on update or is there some kind of signal or event when a Joomla update has completed so I can hook into that in order to check the path and re-add it if necessary after the update?