The current plugin API is functional but it requires that plugins have too much knowledge about other plugins to take advantage of services offered. Having a class based plugin API based on event publishing / subscription would be a more desirable long term platform for plugin development / interaction.
The event system could consist of two classes, the EventMgr and the Event. The EventMgr is where events are registered, subscribed to and fired. The Event class is an object passed to the observer when the event occurs. There could be four (4) types of events: Notice, Request, Allow and Deny.
The Allow and Deny requests can be set to strict or lazy evaluation. With lazy evaluation as soon as one observer returns true, none of the other observers are called. Strict evaluation will call all observers even if the result has been finalized.
Events exist in a two-level name space. There is a domain and a name within the domain. Observers can subscribe to individual named events or all events on the domain. To do so, an observer calls the addObserver method on the EventMgr object.
This function has 4 parameters:
Event types could be stored in the database. The event_type table might list all the valid events registered with the system. This is where information about the event's type (notice, request, allow or deny) and evaluation structure is stored. Subscriptions are made every time the system loads to keep additional DB requests at a minimum to ensure scalability and performance is maintained.
A strong understanding of PHP and object oriented programming will be required. A good understanding of the existing glFusion Plugin API will be helpful.
Difficult
Implementing a new Plugin API will touch every aspect of glFusion and require a significant effort to ensure compatibility and proper integration.
All code must be created using the GNU General Public License