Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpFoundation] Deprecate compatibility with PHP <5.4 sessions#24239
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| publicfunctionsetSaveHandler($saveHandler =null) | ||
| { | ||
| if (!$saveHandlerinstanceof AbstractProxy && | ||
| !$saveHandlerinstanceof NativeSessionHandler && |
nicolas-grekasSep 17, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
should be reverted as that's a BC break, isn't it?
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.
Nope, since Symfony 3.0,NativeSessionHandler always extends\SessionHandler. Thus now the rule!$saveHandler instanceof NativeSessionHandler is covered by!$saveHandler instanceof \SessionHandlerInterface
640661c to71a92a2Compare| */ | ||
| namespaceSymfony\Component\HttpFoundation\Session\Storage\Proxy; | ||
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.
shouldn't you add a deprecated notice here ?
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.
I had one, but removed it becauseAbstractProxy is extended bySessionHandlerProxy and this will make the tests that useSessionHandlerProxy to not pass. I can't mark these tests aslegacy. What's a good solution to have a deprecation notice here and tests pass?
| * | ||
| * @author Drak <drak@zikula.org> | ||
| */ | ||
| class SessionHandlerProxyextends AbstractProxyimplements \SessionHandlerInterface |
afurculitaSep 17, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
I would also move this class from theProxy folder toHandler. What do you think,@nicolas-grekas ?
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.
That would need deprecating this class in favor of the new one, and allow triggering a deprecation in AbstractProxy also. LGTM.
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.
I think theSessionHandlerProxy can be deprecated as well. When we only support\SessionHandlerInterface anyway, the proxy does not provide any value anymore AFAIK. I was meant as a way to make\SessionHandlerInterface and others behave the same.
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.
I was thinking the same. The extra methods thatSessionHandlerProxy is having can easily be moved toNativeSessionStorage as they are relevant only for a native session storage.
sstok left a comment
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.
Some minor comments on the changelog, but it seems the HttpFoundation also has this rather strange commentary usage.
UPGRADE-3.4.md Outdated
| `TranslationDebugCommand`, `TranslationUpdateCommand`, `XliffLintCommand` | ||
| and `YamlLintCommand` classes have been marked as final | ||
| HttpKernel |
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.
Missing capital in the sentence (see other lines in this file).
And each line is separated by a single white line.
| * the `Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy::isWrapper()` | ||
| method has been deprecated and will be removed in 4.0. You can check explicitly if the proxy wraps | ||
| a `\SessionHandler` instance. | ||
| * `NativeSessionStorage::setSaveHandler()` now takes an instance of `\SessionHandlerInterface` as argument. |
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.
Duplicate header (wrong rebase?)
| * `AssetsInstallCommand`, `CacheClearCommand`, `CachePoolClearCommand`, | ||
| `EventDispatcherDebugCommand`, `RouterDebugCommand`, `RouterMatchCommand`, | ||
| `TranslationDebugCommand`, `TranslationUpdateCommand`, `XliffLintCommand` |
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.
This header should beHttpFoundation
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.
Fixed
845d5a6 tof275707Compareafurculita commentedSep 18, 2017
Comments addressed :) |
UPGRADE-3.4.md Outdated
| and `YamlLintCommand` classes have been marked as final | ||
| HttpFoundation | ||
| ---------- |
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.
wrong number of dashes :)
xabbuh commentedSep 20, 2017
Please also update the |
415ddf0 to46c0740Compareafurculita commentedSep 24, 2017
Ready for review. I've also deprecated |
Signed-off-by: Alexandru Furculita <alex@furculita.net>
Signed-off-by: Alexandru Furculita <alex@furculita.net>
| $storage =$this->getStorage(); | ||
| $storage->setSaveHandler(); | ||
| $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy',$storage->getSaveHandler()); | ||
| $this->assertInstanceOf(SessionHandlerProxy::class,$storage->getSaveHandler()); |
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.
we don't change that to avoid conflicts unless the line needs to be touched anyway. so this should be reverted.
| * | ||
| * @param AbstractProxy|NativeSessionHandler|\SessionHandlerInterface|null $handler | ||
| * @param MetadataBag $metaBag MetadataBag | ||
| * @param AbstractProxy|\SessionHandlerInterface|null $handler |
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.
Argument types that are deprecated should be removed from the doc
| * @param AbstractProxy|NativeSessionHandler|\SessionHandlerInterface|null $handler | ||
| * @param MetadataBag$metaBag MetadataBag | ||
| * @param array $options Session configuration options | ||
| * @param AbstractProxy|\SessionHandlerInterface|null $handler |
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.
same, AbstractProxy should not be documented anymore
nicolas-grekas commentedSep 26, 2017
@Tobion OK for you? Can I let you merge if yes? |
Tobion commentedSep 26, 2017
Thank you@afurculita. |
… sessions (afurculita)This PR was squashed before being merged into the 3.4 branch (closes#24239).Discussion----------[HttpFoundation] Deprecate compatibility with PHP <5.4 sessions| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | yes| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -This PR removes functionality added in Symfony 2.1 as a compatibility layer with sessions from PHP <5.4.- [x] Fix testsCommits-------3deb394 [HttpFoundation] Deprecate compatibility with PHP <5.4 sessions
Tobion commentedSep 26, 2017
@afurculita could you work on a PR against master to remove the deprecated stuff? Would be much appreciated. |
afurculita commentedSep 26, 2017
@Tobion already started it ;) |
…5.4 sessions (afurculita)This PR was merged into the 4.0-dev branch.Discussion----------[HttpFoundation] Removed compatibility layer for PHP <5.4 sessions| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | yes| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -This is a follow-up of#24239. This PR removes the compatibility layer added for sessions for PHP <5.4.Commits-------37d1a21 Removed compatibility layer for PHP <5.4 sessions
Uh oh!
There was an error while loading.Please reload this page.
This PR removes functionality added in Symfony 2.1 as a compatibility layer with sessions from PHP <5.4.