mybb / mybb2

The repository for the MyBB 2 forum software. Not to be used on live boards.
https://www.mybb.com
BSD 3-Clause "New" or "Revised" License
109 stars 45 forks source link

Extension System #16

Open euantorano opened 9 years ago

euantorano commented 9 years ago

Provide an easy system to write extensions to the MyBB 2.0 core.

Features

Discussion Points

wpillar commented 9 years ago

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?

euantorano commented 9 years ago

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).

wpillar commented 9 years ago
euantorano commented 9 years ago

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.

wpillar commented 9 years ago
euantorano commented 9 years ago

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.

wpillar commented 9 years ago

YAML is even smaller :P but I take your point about the dependency.