srag / removeplugindataconfirm
Demand if plugin data should be removed on uninstall
Requires
- php: >=7.2
- srag/dic: >=0.1.0
- srag/librarylanguageinstaller: >=0.1.0
- dev-main
- 0.9.0
- 0.8.1
- 0.8.0
- 0.7.8
- 0.7.7
- 0.7.6
- 0.7.5
- 0.7.4
- 0.7.3
- 0.7.2
- 0.7.1
- 0.7.0
- 0.6.6
- v0.6.5
- v0.6.4
- v0.6.3
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.0
- v0.4.1
- v0.4.0
- v0.3.6
- v0.3.5
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.15
- 0.1.14
- 0.1.13
- 0.1.12
- 0.1.11
- 0.1.10
- 0.1.9
- 0.1.8
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
This package is auto-updated.
Last update: 2022-07-18 09:01:35 UTC
README
Demand if plugin data should be removed on uninstall
This project is licensed under the GPL-3.0-only license
Usage
Composer
First add the following to your composer.json
file:
"require": { "srag/removeplugindataconfirm": ">=0.1.0" },
And run a composer install
.
If you deliver your plugin, the plugin has it's own copy of this library and the user doesn't need to install the library.
Tip: Because of multiple autoloaders of plugins, it could be, that different versions of this library exists and suddenly your plugin use an older or a newer version of an other plugin!
So I recommand to use srag/librariesnamespacechanger in your plugin.
Use
First declare your plugin class like follow:
//... use srag\RemovePluginDataConfirm\x\PluginUninstallTrait; //... use PluginUninstallTrait; //... /** * @inheritDoc */ protected function deleteData() : void { // TODO: Delete your plugin data in this method } //...
You don't need to use DICTrait
, it is already in use!
If your plugin is a RepositoryObject use RepositoryObjectPluginUninstallTrait
instead:
//... use srag\RemovePluginDataConfirm\x\RepositoryObjectPluginUninstallTrait; //... use RepositoryObjectPluginUninstallTrait; //...
Remove also the methods beforeUninstall
, afterUninstall
, beforeUninstallCustom
and uninstallCustom
in your plugin class.
Expand you plugin class for installing languages of the library to your plugin
... /** * @inheritDoc */ public function updateLanguages(/*?array*/ $a_lang_keys = null) : void { parent::updateLanguages($a_lang_keys); $this->installRemovePluginDataConfirmLanguages(); } ...
Notice to also adjust dbupdate.php
so it can be reinstalled if the data should already exists!
Requirements
- ILIAS 6.0 - 7.999
- PHP >=7.2