[TwigBridge] Added a TwigEngine in the bridge

This TwigEngine implements the interface available in the component.
the TwigBridge in TwigBundle now extends this class and provides only
the additional methods for the FrameworkBundle interface.
moved event dispatcher classes to the EventDispatcher component
merged branch symfony/event_dispatcher_classes_move (PR #3760)

Commits
-------

93848be moved event dispatcher classes to the EventDispatcher component

Discussion
----------

moved event dispatcher classes to the EventDispatcher component

I have moved the two specialized event dispatcher classes from the FrameworkBundle bundle to the EventDispatcher component.

It makes them reusable outside the Symfony full-stack framework as they can be quite useful (people like @drak has a use for them for instance).

It makes the event dispatcher component *optionally* rely on DependencyInjection and HttpKernel for these classes, like what we have in other components.

What do you think?

---------------------------------------------------------------------------

by stof at 2012-04-02T16:02:01Z

you forgot to update the ``suggests`` section of the composer.json file. Otherwise, it is fine

---------------------------------------------------------------------------

by drak at 2012-04-02T16:06:34Z

w00t, thanks @fabpot!

I'm biased of course, but the optional dependency to `DependencyInjection` is a much more logical dependency that the previous one, to `FrameworkBundle`. It immediately shows of the DIC also.

---------------------------------------------------------------------------

by schmittjoh at 2012-04-02T16:06:39Z

+1, the "no dependencies" should really be changed to "minimal dependencies"

---------------------------------------------------------------------------

by henrikbjorn at 2012-04-02T16:09:48Z

@schmittjoh should properly be "minimal optional dependencies" otherwise people will be scared i think :) And reading "minimal dependencies" reminds me when trying to use a zf1 component standalone.

+1

---------------------------------------------------------------------------

by drak at 2012-04-02T16:12:57Z

@schmittjoh Honestly speaking, some of the Sf2 components do already have a few dependencies with each other, but where there are, they all minimal and rather logical anyway.  It's not like some libraries I could mention where one lib required about 10 deps which each rely on a bunch of other things - in the end, you need everything just for one feature :-P

---------------------------------------------------------------------------

by stof at 2012-04-02T16:14:28Z

@drak there was not optional dependency to FrameworkBundle previously as no code of the component was using FrameworkBundle (the dependency was the other way)

---------------------------------------------------------------------------

by drak at 2012-04-02T16:18:31Z

@stof, yeah but I was talking about other components like Security, DependencyInjection, HttpKernel for example which has a mix of optional and required deps.  It's not true to say all Sf2 components are 100% standalone in all cases.
merged branch stof/twig_engine_move (PR #3761)

Commits
-------

dbab7e1 [TwigBridge] Added a TwigEngine in the bridge

Discussion
----------

[TwigBridge] Added a TwigEngine in the bridge

This TwigEngine implements the interface available in the component.
the TwigBridge in TwigBundle now extends this class and provides only
the additional methods for the FrameworkBundle interface.

This will allow people to support the PhpEngine and Twig in their code more easily when using the component as they don't need to reimplement the class.
I originally thought about when I helped @dragoonis to integrate the Templating component in the PPI framework 2.0 as he talked about adding the support for Twig later too.