Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

javiereguiluz
Copy link
Member

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.

@javiereguiluz
Copy link
Member Author

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Namespaces use backslashes \

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😱 Nice catch! Fixed. Thanks!

@HeahDude
Copy link
Contributor

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'));
Copy link
Member

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()

Copy link
Member Author

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.

Copy link
Contributor

@ogizanagi ogizanagi Apr 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@javiereguiluz :

- $container->setDefinition('app.session_handler', new Definition('AppBundle\Session\CustomSessionHandler'));
+ $container->register('app.session_handler', 'AppBundle\Session\CustomSessionHandler');

http://api.symfony.com/master/Symfony/Component/DependencyInjection/ContainerBuilder.html#method_register

Copy link
Member Author

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.

@javiereguiluz
Copy link
Member Author

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>
Copy link
Member

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.

Copy link
Member

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>

@xabbuh
Copy link
Member

xabbuh commented May 21, 2016

@javiereguiluz Apart from the XML config examples this looks ready to me.

@javiereguiluz
Copy link
Member Author

I've updated the examples to show the full XML config. Thanks!

@xabbuh
Copy link
Member

xabbuh commented May 21, 2016

👍

@xabbuh
Copy link
Member

xabbuh commented Jun 30, 2016

ping @weaverryan @wouterj

@wouterj
Copy link
Member

wouterj commented Jul 2, 2016

Thanks Javier, it looks great!

wouterj added a commit that referenced this pull request Jul 2, 2016
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
@wouterj wouterj closed this Jul 2, 2016
@javiereguiluz javiereguiluz deleted the fix_5844 branch May 24, 2018 16:04
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.

5 participants