Closed
Closed
Copy link
Description
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
?