[HttpFoundation] Deprecate compatibility with PHP <5.4 sessions#24239
[HttpFoundation] Deprecate compatibility with PHP <5.4 sessions#24239afurculita wants to merge 3 commits intosymfony:3.4from
Conversation
| public function setSaveHandler($saveHandler = null) | ||
| { | ||
| if (!$saveHandler instanceof AbstractProxy && | ||
| !$saveHandler instanceof NativeSessionHandler && |
There was a problem hiding this comment.
should be reverted as that's a BC break, isn't it?
There was a problem hiding this comment.
Nope, since Symfony 3.0, NativeSessionHandler always extends \SessionHandler. Thus now the rule !$saveHandler instanceof NativeSessionHandler is covered by !$saveHandler instanceof \SessionHandlerInterface
640661c to
71a92a2
Compare
| @@ -12,7 +12,7 @@ | |||
| namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy; | |||
|
|
|||
There was a problem hiding this comment.
shouldn't you add a deprecated notice here ?
There was a problem hiding this comment.
I had one, but removed it because AbstractProxy is extended by SessionHandlerProxy and this will make the tests that use SessionHandlerProxy to not pass. I can't mark these tests as legacy. What's a good solution to have a deprecation notice here and tests pass?
| * | ||
| * @author Drak <drak@zikula.org> | ||
| */ | ||
| class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterface |
There was a problem hiding this comment.
I would also move this class from the Proxy folder to Handler. What do you think, @nicolas-grekas ?
There was a problem hiding this comment.
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.
I think the SessionHandlerProxy 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.
I was thinking the same. The extra methods that SessionHandlerProxy is having can easily be moved to NativeSessionStorage as they are relevant only for a native session storage.
sstok
left a comment
There was a problem hiding this comment.
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.
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.
Duplicate header (wrong rebase?)
| @@ -202,6 +202,25 @@ FrameworkBundle | |||
| `TranslationDebugCommand`, `TranslationUpdateCommand`, `XliffLintCommand` | |||
There was a problem hiding this comment.
This header should be HttpFoundation
845d5a6 to
f275707
Compare
|
Comments addressed :) |
UPGRADE-3.4.md
Outdated
| and `YamlLintCommand` classes have been marked as final | ||
|
|
||
| HttpFoundation | ||
| ---------- |
There was a problem hiding this comment.
wrong number of dashes :)
|
Please also update the |
415ddf0 to
46c0740
Compare
|
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.
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.
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.
same, AbstractProxy should not be documented anymore
|
@Tobion OK for you? Can I let you merge if yes? |
|
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 tests Commits ------- 3deb394 [HttpFoundation] Deprecate compatibility with PHP <5.4 sessions
|
@afurculita could you work on a PR against master to remove the deprecated stuff? Would be much appreciated. |
|
@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
This PR removes functionality added in Symfony 2.1 as a compatibility layer with sessions from PHP <5.4.