puphpet/puphpet — pull request #253 by frastel (2013-11-04 17:01:32+00:00)
Title: removed hardcoding of extensions by introducing compiler pass for them

In order to use extensions really as extensions the hardcoding of `Extension\Manager` populating has to be removed.
For this purpose I created a compiler pass `Puphpet\MainBundle\DependencyInjection\Compiler\ExtensionPass`. [Compiler passes](http://symfony.com/doc/current/components/dependency_injection/tags.html) could be used to "magically" populate services with stuff from vendor locations during building of the container.

That means during building the container the compiler pass will search for all services tagged with `puphpet.extension` and add them to the manager. In this way an extension could be added without having the need of modifying the original manager definition anymore.

Example:
```
services:
puphpet.extension.mysql.configure:
class: Puphpet\Extension\MysqlBundle\Configure
arguments:
- "@service_container"
tags:
- { name: puphpet.extension, group: "database", priority: 190 }
```

Have a look at the `Resources/doc/index.rst` for more information (e.g the priority).

Compiler passes are really great and are one reason why I wanted to the migration to Symfony2 :)