mybb2
mybb2 copied to clipboard
Extension System
Provide an easy system to write extensions to the MyBB 2.0 core.
Features
- Easy extension of core actions using event subscriptions.
- Extension of templates, inserting data using template hooks.
- Adding of assets (CSS, Javascript) to be loaded with extensions.
Discussion Points
- Ability to bootstrap the creation of a plugin from the Admin Control panel when in
Dev Mode
. - Plugin format:
- Plugin service providers? (may slow the application boot process)
- XML file description of plugins, which can be imported via ACP to install plugin?
I like service providers for this, it's exactly what their purpose is and if configured correctly it shouldn't slow down the application boot process. I also like the idea of a MyBB\ServiceProvider
that can provide an easy API for setting up extensions.
@euantorano what's the idea behind an XML description of extensions?
Also what are we officially calling them? Extensions? Plugins? Packages?
I'd say call them extensions.
The idea behind the XML is basically just a file that describes the plugin - the title, version, description, author, the actual service provider to use, etc.
Regarding Service Providers, they can be a little slow. Perhaps we can optimise that somehow. We should look at what PyroCMS are doing, as they have apparently solved this issue for v3 (which is using Laravel).
- Can we use JSON or YAML instead of XML?
- I'll take a look at PyroCMS 3, I'd be surprised if it caused any real performance issue. Reasonable to expect that if you add 30 extensions to your forum it may slow down a little.
Of course, or we do something similar to how the current system works, where it looks for files in a specific directory extending a specific class. I'd prefer a file of some sort that is uploaded via the ACP. I'd prefer JSON over all else (especially over YAML, as that would be another dependency which isn't particularly needed).
IIRC< they noticed a fairly significant slowdown, but I don't know if they're using Laravel 5 or 4. They fixed it by creating their own version of a service provider I believe which behaves slightly differently. It's certainly worth investigating and benchmarking.
- Fine with JSON, just really dislike XML. I'd prefer a file too, looking for specific directories extending specific classes is nasty.
Oh yeah, I agree XML is nasty. I kind of meant "an XML style structured file", but was too lazy. It just needs to be a file that represents structured data and that can easily be read. A JSON file is smaller too, and far easier to parse.
YAML is even smaller :P but I take your point about the dependency.