Closed JayCarney closed 9 years ago
Great question, and a great use-case. I haven't mind-melded with that part of the code recently, but I believe you can create an "installer.php" (or install.php) file somewhere in there... I have to really look through the source code to remind myself...
No worries, I'll have a look for refernaces to "install" later this week and see what I can find
On Tue, 21 Jul 2015 12:14 pm Everett Griffiths notifications@github.com wrote:
Great question, and a great use-case. I haven't mind-melded with that part of the code recently, but I believe you can create an "installer.php" (or install.php) file somewhere in there... I have to really look through the source code to remind myself...
— Reply to this email directly or view it on GitHub https://github.com/craftsmancoding/repoman/issues/40#issuecomment-123133000 .
So it looks like by following the instructions for database migrations, you can essentially run whatever you like on install/uninstall? or am I interpreting that incorrectly? https://github.com/craftsmancoding/repoman/wiki/Migrations
Ah, docs to the rescue. Yeah, take a look at some of the packages that use custom tables, e.g. https://github.com/craftsmancoding/taxonomies (https://github.com/craftsmancoding/taxonomies/blob/master/model/migrations/install.php)
You can add whatever code you want to that, but you have to keep in mind the scope and the time at which it executes -- you do have access to the $modx variable, which is probably the most important thing.
Is there a way to specify some code to execute on install and/or uninstall? In my specific situation I'd love to create/destroy a custom system event