piwik/piwik — pull request #6555 by mnapoli (2014-10-29 22:46:16+00:00)
Title: Introduced the DI container

I've added the DI container. I've kept things simple for now to have a readable diff.

- require PHP-DI v4.4 (latest)
- added an empty `config/global.php` config file, alongside the existing config files
- the container will also include a 'config/config.php' file if it exists, this file being in .gitignore (so users can override the global config)
- added `Piwik\StaticContainer`, which returns a singleton of the container: this is deprecated already but necessary so that the container can be used in singletons to migrate to DI
- the `FrontController` now uses the container to create controllers

That means that we have DI in controllers.

As an example, I've changed `Piwik\Plugins\Installation\Controller` and `Piwik\Plugins\SitesManager\Controller`, see in the diff tab. I've used annotations here, but I'll change it if we decide in #6548 to not use annotations.