Design pattern for implementing plugins in PHP applications

后端 未结 6 791
温柔的废话
温柔的废话 2021-01-30 23:15

Is there a consensus on how plugins should be implemented in a PHP application?

I\'ve looked into the observer pattern which comes close, it\'s really just a notificati

6条回答
  •  一生所求
    2021-01-30 23:27

    Well, there's a link to the project called jin-plugin right in the Wikipedia article about Plugin concept. I am seeing this framework first time, too, but, maybe, you can use it right away.

    Besides, you should really google for things like "Plugin Pattern", there's just two links I found on first page: Plug-in Pattern, Extensibility pattern (wikipedia).

    If it's really a pattern, it should be language agnostic, so you can safely take any existing solution from any language and convert it to PHP.

    P. S. Thanks for question, anyway, you really did raise my own interest in this topic. ;)

提交回复
热议问题