Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-10739

Dependency Injection Container

    XMLWordPrintable

Details

    • New Feature
    • Status: Unverified Fix (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.1.0-dev
    • 3.1.0-a1
    • None
    • None

    Description

      Since we started using Dependency Injection we have lots of decoupled classes that can be unit tested. That's great. However, assembling these classes is a pain, as you can see by looking at common.php. There's a lot of boilerplate needed. Worse, this is duplicated across common.php, download/file.php, the installer.

      We could solve that by using a Dependency Injection Container, or DIC (worst acronym ever). The DIC knows about all services, and how to create them. Whenever you request a service, it will create it on the fly, including any service that it depends on.

      Configuration of these services takes place in a static YAML file (could also be XML, TXT, INI or plain PHP).

      The Symfony2 DependencyInjection component provides such a container that is pretty much standalone. By adding the YAML and Config components (optional dependencies of DependencyInjection) we can make it even easier to use.

      Tying that into phpBB should be quite easy, and allow us to reduce boilerplate.

      Attachments

        Activity

          People

            igorw Igor Wiedler [X] (Inactive)
            igorw Igor Wiedler [X] (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: