This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Fabien Potencier b3ea939c35 merged branch jalliot/event-subscriber (PR #2021)
Commits
-------

3223c5a Removed now useless test
21cf0ac Backported new behaviour from PR #2148 and removed check for interface at run-time
8b240d4 Implementation of kernel.event_subscriber tag for services.

Discussion
----------

Added missing kernel.event_subscriber tag (closes #2012)

This PR adds a ``kernel.event_subscriber`` tag which allows to register services as event subscribers in the same way ``kernel.event_listener`` allows to register them as event listeners.
The service is still lazy loaded and the DIC does not need to be recompiled for every modification in the service's code.

There is one important thing to remember:
If the service is created by a factory, the class parameter **MUST** reflect the real class of the service, although it is not needed at the moment for the DIC. For that issue, we could either forbid services created by factories or add a note to the documentation.

This PR closes #2012.

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

by jalliot at 2011/08/24 06:42:18 -0700

I'm not sure the test is good enough so feel free to add some more.

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

by jalliot at 2011/08/25 03:46:20 -0700

I re-implemented the check for EventSubscriberInterface in ContainerAwareEventDispatcher because I think the overhead is minimum and it allows to use this method even without the tag (at run-time).
I also added some tests for RegisterKernelListenersPass.

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

by stof at 2011/09/04 02:42:00 -0700

@jalliot Your branch conflicts with the current master. could you rebase it ?

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

by jalliot at 2011/09/04 02:57:03 -0700

Rebased

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

by jalliot at 2011/09/13 02:19:46 -0700

@fabpot What do you think about this PR? At the moment, the subscribers are not really usable in Symfony2 because of the lack of this tag.

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

by fabpot at 2011/09/13 04:17:46 -0700

I don't like subscribers. There are other PRs on adding more support for them, but the reality is that they are complex for no added benefit. I'm wondering if it wouldn't be better to just remove them altogether.

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

by jalliot at 2011/09/13 04:38:20 -0700

@fabpot Well I prefer listeners too but I think that if Symfony2 does support subscribers (which it does at the moment), it should do it properly and completely, thus allowing to register subscriber services like here or to register several methods for one same event like in #2148.
But I guess that if you merged those 2 PRs (well actually this one would have to be modified first if #2148 is merged but I'll do it then), many use cases would be covered and people should stop asking for more support :) (except maybe for removing the static modifier but this would be wrong IMO and prevent entirely this PR).

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

by fabpot at 2011/09/28 11:47:10 -0700

@jalliot: #2148 has been merged. Can you update this PR accordingly? thanks.

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

by jalliot at 2011/09/28 12:00:44 -0700

Sure thing. Will do it as well as removing the check for the interface tonight or tomorrow :)

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

by jalliot at 2011/09/29 08:53:17 -0700

@fabpot Check for interface removed and #2148 merged. Also rebased on latest master.

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

by fabpot at 2011/09/29 09:09:11 -0700

Tests do not pass.

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

by jalliot at 2011/09/29 09:18:48 -0700

@fabpot Fixed
2011-09-29 23:27:29 +02:00
src/Symfony merged branch jalliot/event-subscriber (PR #2021) 2011-09-29 23:27:29 +02:00
tests Merge branch '2.0' 2011-09-29 16:17:23 +02:00
.gitignore Added vendor directory to .gitignore 2010-06-24 10:44:28 +02:00
autoload.php.dist fixed autoloader when tests are run on a machine without intl installed 2011-07-20 14:27:10 +02:00
CHANGELOG-2.0.md updated CHANGELOG for 2.0.3 2011-09-25 11:50:40 +02:00
CHANGELOG-2.1.md added a Size validator 2011-09-29 15:56:37 +02:00
check_cs fixed root search path to include only './src' and './tests' 2011-06-08 18:11:05 +02:00
composer.json updated composer.json for 2.1 2011-09-29 17:32:57 +02:00
CONTRIBUTORS.md update CONTRIBUTORS for 2.0.2 2011-09-25 10:26:33 +02:00
LICENSE added the LICENSE file for the YAML component 2011-02-18 11:52:11 +01:00
phpunit.xml.dist [Security] cleaned up opt-in to benchmark test 2011-03-06 20:06:13 +01:00
README.md [README] Adding a small section with information about contributing. 2011-09-23 11:21:11 -05:00
UPDATE.ja.md updated translation of UPDATE file (Japanese RC5 added) 2011-07-30 02:08:25 +09:00
UPDATE.md updated UPDATE file 2011-07-22 17:45:02 +02:00
vendors.php merged 2.0 2011-09-28 16:08:31 +02:00

README

What is Symfony2?

Symfony2 is a PHP 5.3 full-stack web framework. It is written with speed and flexibility in mind. It allows developers to build better and easy to maintain websites with PHP.

Symfony can be used to develop all kind of websites, from your personal blog to high traffic ones like Dailymotion or Yahoo! Answers.

Requirements

Symfony2 is only supported on PHP 5.3.2 and up.

Installation

The best way to install Symfony2 is to download the Symfony Standard Edition available at http://symfony.com/download.

Documentation

The "Quick Tour" tutorial gives you a first feeling of the framework. If, like us, you think that Symfony2 can help speed up your development and take the quality of your work to the next level, read the official Symfony2 documentation.

Contributing

Symfony2 is an open source, community-driven project. If you'd like to contribute, please read the Contributing Code part of the documentation. If you're submitting a pull request, please follow the guidelines in the Submitting a Patch section.