How about starting with a class, PluginManager, which would be responsible upon creation to scan a directory for plugins. These plugins would have to follow a distinct naming pattern to allow the manager to access the main class of the plugin. Suppose we have a directory, ../plugins/, which contains the plugins used by the system. Each of these plugins would need to be named after their primary class. For instance, SamplePlugin.php would contain a class SamplePlugin which the system would instantiate and utilize. The PluginManager would find this file, include it, and verify that it is a proper plugin.
Another important aspect of the plugin is that it must implement a protocol, or interface, that the system understands and takes advantage of to provide the link between system and plugin. I'm not sure how much power a plugin could be given or how much access to the system it could be granted but I am sure after some tests and examples I could figure out a way. There are a lot of holes in this design, but it's a place to start. I would like to be able to write plugins such as an XML-RPC interface, etc. Movable Type includes a plugin system which is used with HTML templates and output. I would also like to include this functionality. It's a rather complicated mess, come to think of it, but once I begin working on it or I get even clearer ideas from others will it begin to make sense.
Regards, Eric Czarny
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php