Extension Installation - Run Once?
Hi
Is it possible to create an update of an extension, e.g. Gallery, where the new version will perform database modifications only once, like TL's liveupdate tool. Is there a script or some hook that can be run once, and then removed. I'm trying to comply to the new Comments system for the Gallery, but this means that when you just straight upgrade, TL will simply remove the tl_gallery_comments table, removing all existing comments. I'd like to convert them to entries in tl_comments before the database update is run to remove the table tl_gallery_comments
Any ideas? Leo, Peter, Fred?
Re: Extension Installation - Run Once?
If you create a file system/runonce.php, it will be executed once and then deleted automatically.
Re: Extension Installation - Run Once?
hey leo
Thanks for taking the time to answer this. Does this file get executed after file install and before the DB update in the Extension Manager install process?
PS. What happens if there are dependencies and they also have the file runonce.php. something will get overwritten here, right? This is especially true if you change the way a hierarchy of apps work together and/or your extension is dependant on another and that person puts in a runonce as well (without your knowledge).
Re: Extension Installation - Run Once?
If the file exists, it is being executed upon the next request = right after the extension files have been extracted.