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

[HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN #34177

Merged
merged 1 commit into from
Oct 30, 2019

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Oct 29, 2019

Q A
Branch? 4.4
Bug fix? no
New feature? yes
Deprecations? no
Tickets -
License MIT
Doc PR -
framework:
    session:
        handler_id: 'redis://localhost'
        handler_id: '%env(REDIS_URL)%'
        handler_id: '%env(DATABASE_URL)%'
        handler_id: 'file://%kernel.project_dir%/var/sessions'

etc.

the database connection is not shared with the ORM (don't mess with transactions.)
redis/memcached connections are shared between cache and session.
(as a reminder, cache and ORM share the db connection: we're ok with trashing the cache on a rollback)

Lock-related changes are a follow up of #34043.
(fabbot failure is false positive)

@fabpot
Copy link
Member

fabpot commented Oct 30, 2019

Thank you @nicolas-grekas.

fabpot added a commit that referenced this pull request Oct 30, 2019
…e session handler with a DSN (nicolas-grekas)

This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

```yaml
framework:
    session:
        handler_id: 'redis://localhost'
        handler_id: '%env(REDIS_URL)%'
        handler_id: '%env(DATABASE_URL)%'
        handler_id: 'file://%kernel.project_dir%/var/sessions'
```

etc.

the database connection is not shared with the ORM (don't mess with transactions.)
redis/memcached connections are shared between cache and session.
(as a reminder, cache and ORM share the db connection: we're ok with trashing the cache on a rollback)

Lock-related changes are a follow up of #34043.
(fabbot failure is false positive)

Commits
-------

de9c61f [HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN
@fabpot fabpot merged commit de9c61f into symfony:4.4 Oct 30, 2019
@nicolas-grekas nicolas-grekas deleted the hf-session-dsn branch October 30, 2019 13:53
This was referenced Nov 12, 2019
nicolas-grekas added a commit that referenced this pull request Dec 13, 2019
…Jan Christoph Beyer)

This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] fix redis multi host dsn not recognized

| Q             | A
| ------------- | ---
| Branch?       |  4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34477
| License       | MIT

#34177 added support configurating session handlers with DSNs. It was no possible to pass a redis-DSN like
`redis:?host[localhost]&host[localhost:6379]&host[/var/run/redis.sock:]&auth=my-password&redis_cluster=1'`

since the check was
`case 0 === strpos($connection, 'redis://'):`

Commits
-------

81ba07a fix redis multi host dsn not recognized
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.

4 participants