The logic behind the plugin system?

I have an application in PHP (private CMS) that I would like to rewrite and add some new things - I would like to expand the application faster using plugins

But the problem is that I don’t know how to achieve β€œcapacity”, how to make a system that recognizes plugins and embeds them in the application?

So what is the logic of a simple plugin system?

+4
source share
1 answer

Usually plugins will implement a common interface. An application using these plugins will download each plugin from the repository (for example, a library into a directory) and use a common interface to communicate with them. You can extend this so that plugins implement one or more of a set of common interfaces.

Difficulties include determining which interface to define will be useful not only now, but also for future plugins. You also need to worry about poorly written plugins. What happens if the plugin throws an exception? Or maybe if he stops responding. If you allow malicious plugins to crash your system, or you must be isolated from this.

+1
source

Source: https://habr.com/ru/post/1309208/


All Articles