Plugin systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm looking to build a plugin system for my web application. I'm going to need to handle multiple types of plugin. I know that many of them exist already, but I'm wanting something that's very object- clean and PHP5-aware. I was thinking about using multiple interface implementations, so that I could have a plugin that provides a particular kind of database access, provides a user interface for admin purposes, and a simple display unit perhaps for connection status. In this case I'd define a class like:

class mynewplugin extends pluginbase implements database, admin, display {
  //...
}

I would then be able to introspect (using class_implements etc) to find, for example, all plugins that implement database access. I could easily add more plugin types by adding more interface types. The overall benefit being that all kind of plugin are handled through a single mechanism.

Does this sound like a solid structure and mechanism?

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcus@xxxxxxxxxxxxxxxxxx | http://www.synchromedia.co.uk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux