MyBB Ideas
The MyBB Ideas site allows users to suggest new features and changes in MyBB and the MyBB Group to easily review them to decide what direction MyBB should head in. Search existing ideas.
Plugin System Redesign
|
45 votes
|
Now that OOP is also finding its way to the PHP world, I would like to suggest another approach of the plugin system of MyBB, namely a class-based pluginsystem. By using classes you eliminate function-name conflicts and instead of hooking certain functions to certain predefined hook, you just give the function the same name as the hook. function activate() function deactivate() function postbit($post) Getting the hooks can then be done automatically: When MyBB needs to run a hook, all it needs to be done is loop through the $plugin_hooks array for that hook:
|
7 Comments
-
Choli, 8th June 2007, 11:09:25 PM
I like the idea, but I have a question (i'm not very used to work with objects in php): Is that code as fast/optimum (measuring execution time and memory consumption) as current implementation of the plugins? Is it as powerful as current implementation? (i mean if you can do the same things (as easyly) as before)
-
Aries-Belgium, 9th June 2007, 8:34:31 AM
It's even more easily, because you don't need to hook the functions to their hooks. My implementation should do that automatically. And in terms of speed: a great advantage is that you can store objects in an array and that you can serialize that array and store it in a session, database, file, ... for caching purposes.
-
Ryan Gordon, 10th June 2007, 3:41:57 AM
Very nice idea. Actually, I'll definitely look into it for a later version.
-
DennisTT, 11th June 2007, 6:49:45 AM
Yeah it looks like a good idea.
-
labrocca, 25th June 2007, 6:00:00 AM
Yes but how will this effect the many existing plugins already? I would certainly be rather upset if I had to rewrite large portions of code to make it compatible with a new system. Your implementation might be great but one has to consider other aspects too.
-
CraKteR, 2nd July 2007, 9:20:29 PM
We could of course make them both be valid formats. :)
-
laie_techie, 23rd September 2007, 9:29:33 PM
I like the idea of going object-oriented, but you still have to register which hooks a particular plugin is interested in.
Post a Comment
Before you can post a comment you must be a registered member of the MyBB Community Forums.
If you already have an account, log-in to it to post a comment or if you don't register a new account.