-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[2.2] [HttpFoundation] Add redis session storage #4538
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
Conversation
public static function setUpBeforeClass() | ||
{ | ||
if (!extension_loaded('redis')) { | ||
self::markTestSkipped('The "redis" extension must be loaded'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you actually skip in beforeClass ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you can skip the test in setUpBeforeClass
.
Because, markTestSkipped is a static method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Baachi thanks for the tip I had never taken the time to look at the src code before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vicb No problem :)
Do you have other suggestions?
@vicb Any plans for getting this in Symfony? |
What happend actually with the old redis session handler (#3498)? |
@bodokaiser All native session handlers were removed in PR #4454. |
@Baachi Thank you for the fast answer! When does your PR get merged? |
@bodokaiser I don't know. |
I don't have much spare time to work on Sf2 this month. Some quick remarks however:
The best way would be to configure the native session handler in your php.ini file |
@vicb This doesn't work practically. When I use a plain php file with session_start(); and a configured redis session handler (php.ini) it works. The session gets saved in redis but when I use Symfony the session is handled in another way (redis doesn't have any session values). Correct me if I have forgotten to use custom session settings in config.yml |
@Drak has the FrameworkBundle config been updated to support php.ini config ? |
@stof Should i close this PR? |
ping |
We have removed all native session handlers. So, if the native Redis storage as configured in the php.ini does not work, we need to fix it. |
I'm using the native session handlers via php.ini in a 2.0 and 2.1 project, both are working. |
If they the native session handlers are working, I propose to close this PR. |
@fabpot - yes close it. I'm going to release a bundle with the removed handlers shortly. |
Closed. :) |
This PR was merged into the 4.1-dev branch. Discussion ---------- [HttpFoundation] RedisSessionHandler | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #24433, #18233, #14539, #4538, #3498 | License | MIT | Doc PR | symfony/symfony-docs#8572 Ability to use Redis as a session storage backend. Discussed in detail in linked issues / PRs. Commits ------- 8776cce [HttpFoundation] Add RedisSessionHandler
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -
This session storage use the redis PHP extension.