-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Updated the session proxy article #5892
Conversation
Could I get a review for these changes? Thanks! |
@@ -24,6 +79,9 @@ Encryption of Session Data | |||
If you wanted to encrypt the session data, you could use the proxy to encrypt | |||
and decrypt the session as required:: | |||
|
|||
// src/AppBundle/Session/EncryptedSessionProxy.php | |||
namespace AppBundle/Session; |
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.
Namespaces use backslashes \
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.
😱 Nice catch! Fixed. Thanks!
I left some very minor comments but I like your changes 👍 |
use Symfony\Component\DependencyInjection\Definition; | ||
use Symfony\Component\DependencyInjection\Reference; | ||
|
||
$container->setDefinition('app.session_handler', new Definition('AppBundle\Session\CustomSessionHandler')); |
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.
you can simply use register()
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'm sorry but I don't understand this 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.
- $container->setDefinition('app.session_handler', new Definition('AppBundle\Session\CustomSessionHandler'));
+ $container->register('app.session_handler', 'AppBundle\Session\CustomSessionHandler');
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.
Thanks @ogizanagi! It's fixed now.
I've fixed most of the issues reported by reviewers. |
<!-- app/config/services.xml --> | ||
<services> | ||
<service id="app.session_handler" class="AppBundle\Session\CustomSessionHandler" /> | ||
</services> |
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 we should use a complete XML example here and below.
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.
So it should be:
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="app.session_handler" class="AppBundle\Session\CustomSessionHandler" />
</services>
</container>
@javiereguiluz Apart from the XML config examples this looks ready to me. |
I've updated the examples to show the full XML config. Thanks! |
👍 |
ping @weaverryan @wouterj |
Thanks Javier, it looks great! |
This PR was submitted for the 2.3 branch but it was merged into the 2.7 branch instead (closes #5892). Discussion ---------- Updated the session proxy article | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | #5844 I'm not sure if this is what @xabbuh was talking about in the related issue. Commits ------- a09d1f2 Updated the session proxy article
I'm not sure if this is what @xabbuh was talking about in the related issue.