From phpBB Development Wiki
Using the Symfony 2 PHP framework
I propose to build phpBB4 using the Symfony 2 full-stack web framework.
Use Area51 to discuss this RFC.
What is Symfony 2?
Symfony 2 is a rewrite of the popular symfony web framework for PHP. Symfony 2 was created in an attempt to solve the problems that became apparent in version 1 (there are versions 1.0 to 1.4). Symfony, being a framework and all users consequently being developers, has a very large active community of PHP developers. There is a very large set of plugins solving all sorts of problems available for symfony 1 which promises extensive resources for Symfony 2 in due time.
Why Symfony 2 for phpBB4?
The following is a list of previous decisions and goals for phpBB4, each followed by an explanation of how Symfony 2 realises the requirement. The list is based on items you can find in the phpBB4 Programming Principles section of the wiki that was set up a while ago. This can only give you a small idea, you should really look at the Symfony 2 website and you might dive into the code as well to get a better understanding.
- phpBB4: PHP 5.3+ code
- Symfony 2 was rewritten from the ground up to use PHP5.3 code, entirely consistent with the phpBB4 approach.
- phpBB4: Use of namespaces and the autoloading standard
- Symfony 2 is the first framework to entirely follow the autoloading standard for PHP5.3, aimed at improving PHP project interoperability.
- phpBB4: Clean modular extensible object oriented code with decoupled clases
- Symfony 2 is an object oriented framework. A lot of thought is being put into Symfony 2's design to make sure that its architecture is as simple as possible and that its APIs are easily understandable. It makes use of suitable object oriented design patterns and has testability in mind. All functionality is achieved through bundles allowing for maximum extensibility.
- phpBB4: Plugin infrastructure that can fully replace MODs without requiring any code changes
- Symfony 2: As I mentioned before all Symfony 2 functionality is achieved through bundles that do not require code modifications. Symfony 2 does make use of generated code, but it does not make sense to edit that generated code manually, and it can be regenerated at any time.
- phpBB4: Using existing libraries / frameworks rather than reinventing the wheel
- Symfony 2: The very use of a framework like Symfony 2 already brings us a lot closer to fulfilling this goal. In addition Symfony 2 follows the same approach and makes use of some Zend Framework components for features like caching or logging. Symfony 2 does not try to provide everything but promotes the idea of chossing the best tool for the job.
- phpBB4: Easy integration into 3rd party software
- Symfony 2: Using Symfony 2 phpBB4 would automatically become very easy to integrate into any Symfony application. The design of Symfony 2 would also require us to design phpBB in such a modular way, that using phpBB4 from within an application not based on Symfony should be easily achievable, as long as the application can send phpBB the input Symfony would usually provide, call phpBB in the way, that Symfony would otherwise do and make use of its output.
- phpBB4: Scalability (running on clusters in particular)
- Symfony 2: Symfony has a history of running high end services, and Symfony 2 is designed for high performance so this should come naturally.
- phpBB4: Consistent use of Dependency Injection
- Symfony 2 is build around the Symfony Dependency Injection Container, using Dependency Injection everywhere.
- phpBB4: Extensive automated testing: Unit tests, integration tests and functional (UI) testing with PHPUnit, Selenium
- Symfony 2 has extensive automated testing and allows projects to use any testing framework they choose.
- phpBB4: A phpBB development framework (build applications based on phpBB, standardize our framework into a library, as mentioned earlier)
- Symfony 2 is a framework and makes much more sense than a framework specific to phpBB. Parts of phpBB will still easily be reusable from within other frameworks that implement the PHP project interoperability standards.
It is absolutely amazing how Symfony 2 matches exactly what we described as requirements for phpBB4.
What else can Symfony 2 give us?
Since Symfony is used and known by such a large group of developers, we can hope for a lot of new contributors. Customers requiring a forum integration into a Symfony application is a common problem for developers using the Symfony framework. Rather than building their own small and very simple bulletin board such developers are much more likely to use phpBB if it is easily integratable. Developers with this problem might contribute phpBB features they add or change back to phpBB. They are also knowledgable enough to identify and fix bugs themselves, so we can hopefully expect good patches for bugs, too.
Check out the website at http://symfony.com to learn a lot more about Symfony 2.