Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted December 3, 20177 yr I've read through the docs, as well as system/Plugin/Plugin.php, and it looks like there's no way to have a plugin perform its own uninstallation actions on delete. Have I missed something? This seems rather a large oversight, given that the official docs mention modifying the core tables multiple times (including in the official example!) without a way to undo these changes when deleting the plugin.
December 3, 20177 yr in system/Plugins/Plugins.php on line 530: if ( file_exists( \IPS\ROOT_PATH . '/plugins/' . $this->location . '/uninstall.php') ) { require_once \IPS\ROOT_PATH . '/plugins/' . $this->location . '/uninstall.php'; } i imagine if you created a uninstall.php in your plugin's root, you could do stuff in it like: \IPS\Db::i()->dropColumn( 'mytable', 'myaddedcolumn'); \IPS\Db::i()->dropTable('myaddedtable'); //etc (sorry i don't really make all that many plugins, just apps, and the process is a bit different there).
December 3, 20177 yr Author How did I miss that! Thanks. Yeah, I mostly do apps myself...thus my lack of familiarity with how to do this in plugins
December 3, 20177 yr i almost missed it, its sorta messy in that area, and you might've not to think "delete" was the "uninstall" method to a plugin. i backtraced it from the plugins controller to in Core to see what it was doing
Archived
This topic is now archived and is closed to further replies.