wohali Posted December 3, 2017 Share Posted December 3, 2017 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. Link to comment Share on other sites More sharing options...
CodingJungle Posted December 3, 2017 Share Posted December 3, 2017 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). Link to comment Share on other sites More sharing options...
wohali Posted December 3, 2017 Author Share Posted December 3, 2017 How did I miss that! Thanks. Yeah, I mostly do apps myself...thus my lack of familiarity with how to do this in plugins Link to comment Share on other sites More sharing options...
CodingJungle Posted December 3, 2017 Share Posted December 3, 2017 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 Link to comment Share on other sites More sharing options...
bfarber Posted December 4, 2017 Share Posted December 4, 2017 uninstall.php is the answer here, yes. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.