Open hostyle opened 5 years ago
PluginInstaller cannot know what is removed if you doesnt define that. You cannot purge all plugins in the folder because not all plugins are installed over the plugin installer. You have to manually uninstall that in the backend or over console command.
I recently came across a secondary related issue.
If you have version 1.0 of a plugin installed with store-plugin-installer, and version 1.1 with file/folder structure changes is released and you try to install that, it will install 1.1 on top of the existing 1.0 plugin meaning any files that were to be removed from 1.0 in the upgrade will remain alongside any new files from 1.1. This can cause issues in particular for any javascript files in eg. Resources/frontend/js/. If 1.1 had Resources/frontend/js/script-v1.0.js and 1.1 had Resources/frontend/js/script-v1.1.js - you now have both scripts and both will run, possibly duplicating functionality or clashing with each other.
Would it be possible to check if a plugin already exists on disk and remove it before re-adding it? Or to compare version before copying new files on top of older version?
Plugins that get installed using this method do not appear to be removed if their entry is removed from composer.json.
Before:
$ composer install
$ ls custom/plugins
After:
$ composer update
$ ls custom/plugins