Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Provides a SessionFactoryInterface #40184

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 1 commit into from

Conversation

jderusse
Copy link
Member

Q A
Branch? 5.x
Bug fix? no
New feature? yes
Deprecations? no
Tickets -
License MIT
Doc PR

When working on the documentation for the deprecated session.storage service, I realized that (https://github.com/symfony/symfony-docs/pull/14981/files#diff-b16540b9555d18f5dcf58902701dc1aa291887390fe5e8401478a4d36f121df2) people may need to override the SessionFactory.

This PR adds a interface to make things cleaner.

@chalasr
Copy link
Member

chalasr commented Feb 14, 2021

Should we add an autowiring alias for it?

@chalasr chalasr added this to the 5.x milestone Feb 14, 2021
@jderusse jderusse force-pushed the session-factory-interface branch from ed2dcb8 to b6e65ab Compare February 14, 2021 15:28
@jderusse
Copy link
Member Author

Should we add an autowiring alias for it?

No strong opinion about this. I added the alias (and also an alias for SessionStorageFactoryInterface for consistency)

@nicolas-grekas
Copy link
Member

I'm mixed here. This looks mostly internal. Yes, we should allow ppl to write their factory, but tight coupling via inheritance doesn't look that bad. I'm not sure about the autowiring aliases. Why would ppl need these as "tools" in their apps?

@derrabus
Copy link
Member

derrabus commented Feb 15, 2021

I don't think we need that interface.

The session factory encapsulates the boilerplate that we need when working with the session storage factory. I don't think that anyone would need a different implementation of the session factory because it's the storage factory that can and should be replaced instead.

In #39634 we've decided not to add an interface for the lock factory and I personally don't see a reason to decide differently for the session factory.

@chalasr
Copy link
Member

chalasr commented Feb 15, 2021

My comment was mostly challenging the usefulness of such an interface: if we don't want people to type-hint against it, then I don't think we need it either.

@fabpot
Copy link
Member

fabpot commented Feb 15, 2021

An interface for a factory always sounds suspicious to me :)

@jderusse jderusse closed this Feb 15, 2021
@jderusse jderusse deleted the session-factory-interface branch February 15, 2021 17:13
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.

6 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.