Open SOF3 opened 6 years ago
A prerequisite of proposals 2 and 3 is to enforce semantic versioning in plugins. Many years ago, there were plugins that looked like this:
version: 1.5.0 THE REDSTONE UPDATE DOWNLOAD NOW
I think this was a feature of pocketmine-soft 🤔
It was
In light of the rising number of "API plugins" in the plugin ecosystem, there might be the need to have PocketMine install dependencies automatically.
Proposal 1: Dependency URL in plugin.yml
It is proposed that the following format be allowed in plugin.yml:
If the plugin
FormAPI
is not installed, PocketMine will automatically download it from the URL provided.Proposal 2: Dependency version in plugin.yml
It is proposed that version constraints be allowed in plugin.yml in a similar way to the
extensions
property. In conjunction with proposal 1, the syntax could be like this:(Note that the
^
syntax is not supported in Poggit yet, and it is just an example)Proposal 3: Common dependency resolution
If two plugins depend on the same plugin but at different versions, PocketMine should attempt to resolve the dependency for the higher version. For example, if there are two plugins:
PocketMine should note that
PluginTwo
requires a higher version, so its dependency should be used instead of PluginOne's dependency. If FormAPI 1.0.0 was already installed, it should be automatically updated.Problem: This allows automatic installation of plugins. Is this bad?
The same could be achieved in plugins by downloading the plugin in
onLoad()
and loading it first. I would not consider this as a new attack vector, considering that plugin.yml should be reviewed in the same way as the PHP code.