Session: phpBB “Ascraeus” 3.1: News for MOD Authors by Henry Sudhof
Date/Time: Saturday 8/21 at 1:30-2:10 PM
This post contains my rough crib-notes from this presentation at Libertyvasion 2010. The post has not been proof-read for spelling, grammar, or accuracy.
The phpBB3 code-base looks like a bunch of spaghetti code. (Showing a picture of spaghetti on the screen.)
phpBB 3.0 introduced modules (plug-and-play), but were limited to adding pages to the control panels, and is not well understood. There are also plugins, which work for the search, CAPTCHA, auth, and cache. However, the functionality of these varies, there are different non-uniform APIs, and it’s not well adopted. And there are also hooks which alter phpBB’s behavior, but these are mainly intended for wrapping phpBB within other applications. They are rather limited, and by-and-large have not been adopted. Instead, we are using MODs, which are glorified patchfiles, but have excellent adoption.
MODs aren’t necessarily bad. They provide unlimited expressive power, are simple to understand, have a shallow learning curve, have been adopted very well, are a well-documented format, offer good performance, and benefit from MOD Team audits. However, there is a non-uniform codebase, creating difficulties with maintenance, it impedes updating phpBB, can cause conflicts and side-effects, and are difficult to install, among other issues. (Yet another picture of spaghetti on the screen.)
phpBB 3.1 introduces hooks into the system, meaning that the phpBB code will call and run all functions hooked into particular places of execution in the code
In order to do this, the old hook system is going to have to be rewritten. “Hooks have to be fun.” They need to be able to resolve conflicts (within limits), allow for easy placement, and make it easier to implement hooks.
phpBB 3.1 will have “automagic” hooks, using PHP OOP methods. Examples of the under-the-hood code that enables these to work being shown.
Flavors: Injection, Validation, Callback registration, Event, System, Altering, Cron, and many others.
phpBB needs ideas of where to place hooks, help with the MOD installer in hooks, community support for this implementation, and lots of testing of these hooks.
Thanks that won’t happen in phpBB 3.1: Forms not built by any form API, nor will there be pretty URLs (URL rewriting).
Douglas comments that hooks are a big step for making more pluggable MODs, and it’s the main reason why WordPress Plugins are as successful and as plentiful as they are. However, in order for the hooks system to be successful, MOD authors really need to share feedback on where hooks should be added within the phpBB 3.1 core.
Stefan asks about why phpBB isn’t deciding to adopt Symfony’s hooking system within 3.1 to help reduce the spaghetti code and make future transition easier: the main issue is that phpBB 3.1 still needs to support PHP 5.2.x.