Quote from: infoclipper at Aug 14, 2005, 12:16 AM
Two thoughts on my initial reading (keeping in mind I have been up for three straight days now working on the new manager w/ no sleep):
...
2. If you have two plugins with a function named init(), which is what it looks like you are suggesting, the entire system breaks. Hence the classes: six plugins can use the same function names and no one cares. In fact, this is actually DESIRED since you can create a common API. $plugin->getEvents(), for instance, can return the events the plugin wants to listen to regardless of the type of plugin. Or $plugin->doInstall(); can always run the install for the plugin, creating any needed tables, etc. Standardization and predictability is key.
As for filesystem: actually, it would be exceedingly more difficult to be more inefficient than the system currently is, from memory storage to caching to a lot of the DB structure.
And execution order *definitely* needs to be controllable by the programmer.
Can we gain the best of both worlds, perhaps? With a DB-based plugin system, you get all the GUI-goodness when appropriate. However, with a new caching system, it could actually compile all the related events into a single cache file. For example, if you had five plugins that listen to some event, it could compile all five into a single cache file that gets executed from a single include call vs. five includes.
From the management side, I’d think that’s just another level of security that needs to be added to Manager Roles (can edit plugin config, can edit plugin execution order).
No system of any complexity should remove that control from the ones writing the code. I have at least a dozen ideas for plugins that execution order is a necessity; it’s not even possible to write them without that control. Heck, even the most simplistic blogging software has these controls built into the API; no way we are going to ever be taken seriously while stripping such control from the programmers-- execution order is even the first thing they teach in freshman level programming courses!
Here’s where the beauty of a file-system based plugin architecture shines. And it’s very similar to what programs like Photoshop do anyway, but that’s another argument entirely. Drop it here and it just automagically works. The likelihood of an average user EVER needing to alter a plugin execution order is remote at best. However, the ability to backup a site via the database is pretty compelling too. I think vBulletin does a lot of their managment stuff via the Database for this reason.
However, if we come up with a great installer/packager AND a killer caching system AND a more robust security/access/roles model for manager functions for the plugins/modules/etc., then the argument for the file system based approach is not quite as weighty in my book and I lean back towards the pure-manager based approach.
But regardless, I like both solutions and think either way will be a definite improvement over what we’ve got today, no questions asked.