Help us making MODding in phpBB 3.1 easy

Posted by Kellanved in Development, Modifications with the tags on August 20th, 2010

As we’ve said before, phpBB is getting hooked. Now, we need your help to determine at which points in the code hooks are required to make MODs easier to create and install.

MODs are what makes phpBB work. Without MODs, it would not be the community or the software that it is. However, there is a downside. At the moment, most MODs have to alter the actual code of the software making it hard to install updates or other MODs. Hence, we want to make this a thing of the past: phpBB is getting hooked.

Hooks are in themselves a simple concept: at certain places it is possible to hook into the code, altering the behavior of the software. Where exactly these places are and what change to the behaviour they incur is up to you. We need your help in deciding this.

The hook concept of phpBB 3.1 is based on the idea of “automagic” hooks, replacing the wrapping hooks used in 3.0. If your MOD implements a method matching the hook’s name, phpBB will invoke it at the appropriate places. Even more, MODs can introduce their own hooks, making it possible to MOD the MOD.

However, just being called is just half the solution. A hook also needs semantics, telling phpBB what to do with the results. Thus, hooks can have many different roles. They might be used to register a callback, or they might be used to just add output. Or to change results. Or to alter a query. Etc. We need your ideas to make this great.

To this end we have created a hook RFC forum at area51. We have created a template to make it possible to share the ideas:

Posting your RFC
Your RFC should include the following items:

  • Name: the name of your hook, for instance hook_link. Note that the hook_ prefix is required.
  • Rationale: why do you think that the hook would be a good idea, examples for possible MODules etc. Please include at least one use case for your hook idea.
  • Placement: Where in the phpBB code should your hook be placed
  • Input arguments: The number, type and content of the input variables
  • Output format: the structure of the array returned by the hook (if any)
  • Output semantics: code snippet and text showing what phpBB should do with the result array.
  • Infrastructure: If your hook is to be used to register a functionality, then please detail this functionality.
  • Related: a list of other hooks doing similar things or which might be used together with your proposal.

Comments are closed.

Commenting is disabled for this blog post