Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

PdoSessionHandler::buildDsnFromUrl not compatible with Doctrine Connection URL #40290

Copy link
Copy link
Closed
@bcremer

Description

@bcremer
Issue body actions

Symfony version(s) affected: All Versions
Description
The Connection URL support in PdoSessionHandler does not support the unix_socket connection options like the doctrine connection factory does.

How to reproduce

.env

DATABASE_URL=mysql://myusername:mypassword@localhost/mydb?unix_socket=/run/proxysql/proxysql.sock

config/packages/doctrine.yaml

doctrine:
  dbal:
    driver:   "pdo_mysql"
    url: '%env(resolve:DATABASE_URL)%'

config/services.yaml

  Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler:
    arguments:
      - '%env(DATABASE_URL)%'
      - { db_table: 'Session' }

The doctrine connection and components direly using the PDO Connection will work. Setup of the Session Handler will fail because the unix_socket part will be discarded.

Possible Solution
Add support for unix_socket in PdoSessionHandler::buildDsnFromUrl

Would you accept a PR adding unix_socket support to buildDsnFromUrl?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.