Skip to content

Restore SessionListener class for backward compatibility with Silex #22171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Mar 26, 2017

Q A
Branch? master
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets silexphp/Silex#1496
License MIT
Doc PR N/A

The PR #21625 renamed the classes from Symfony\Component\HttpKernel\EventListener :

  • ...\SessionListener to ...\AbstractSessionListener
  • ...\TestSessionListener to ...\AbstractTestSessionListener

This is breaking the Silex class that extends it.

To keep the backward compatibility, abstract classes are renamed to their original names and subclasses using container injection are prefixed by ContainerAware.

Also added some tests.

SessionListener and TestSessionListener are extended outside of Symfony
in Silex. These classes cannot be renamed.
@nicolas-grekas
Copy link
Member

Looking at the failure, the core issue is:
PHP Fatal error: Interface 'Symfony\Component\DependencyInjection\ServiceSubscriberInterface' not found

@nicolas-grekas nicolas-grekas added this to the 3.3 milestone Mar 28, 2017
@nicolas-grekas
Copy link
Member

I'm going to take over this one. To me, we just need to remove ServiceSubscriberInterface from the interfaces implemented by SessionListener and TestSessionListener.

@GromNaN
Copy link
Member Author

GromNaN commented Mar 28, 2017

Removing the ServiceSubscriberInterface solves the issue of having a hard dependency to the DI component. But ...

fabpot added a commit that referenced this pull request Mar 31, 2017
…*SessionListener (nicolas-grekas)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[HttpKernel] Dont implement ServiceSubscriberInterface on *SessionListener

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #22171, silexphp/Silex#1496
| License       | MIT
| Doc PR        | -

Implementing `ServiceSubscriberInterface` creates a dep on the DI component, which Silex can't afford. Let's revert that part.

@GromNaN can you please confirm this fixes your issue?

Commits
-------

7cd90f5 [HttpKernel] Dont implement ServiceSubscriberInterface on *SessionListener
@fabpot fabpot closed this Mar 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants