PHP Plugins System [duplicate]
Possible Duplicate:
Best way to allow plugins for a PHP application
I'd like to learn how does the php plugins system works. So can anyone explain the idea of it for me in detail, I saw many posts and explanations but I didn't learn and understand any of it.
I meant if I want to make a plugins system for my PHP script, how?
PHPplexus to the rescue.
http://code.google.com/p/phpplexus/
A simple solution would be PHPHooks, which works in a similar way to WordPress' use of hooks:
http://code.google.com/p/phphooks/
You could use the Event Dispatcher library to fire events at the "hook points" of your code. Modules could then register as observers for the events.
If you want to have a look at plugin systems in real-world applications, I would suggest having a look at Dokuwiki which has a nice event system. Also have a look at Drupal which has a module/plugin system that's based on naming conventions.
精彩评论