-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Document host parameter and external parameters in "How to Use PdoSessionHandler..." #9493
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
Document host parameter and external parameters in "How to Use PdoSessionHandler..." #9493
Conversation
- add host parameter to first argument useful when database is on another host e.g. docker grid - wrap parameter values in %env()% - add note how to use external parameters
doctrine/pdo_session_storage.rst
Outdated
array( | ||
'db_table' => '%env(SESSIONS_TABLE)%', | ||
'db_username' => '%env(MYDATABASE_USERNAME)%', | ||
'db_password' => '%env(MYDATABASE_PASSWORD)' |
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.
The trailing comma in the last element of the arrays is missing, look #8325
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->autowire(PdoSessionHandler::class)
->setArguments( \
array( \
'mysql:dbname=%env(MYDATABASE_NAME)%, host=%env(MYDATABASE_HOST)%',
array(
'db_table' => '%env(SESSIONS_TABLE)%',
'db_username' => '%env(MYDATABASE_USERNAME)%',
'db_password' => '%env(MYDATABASE_PASSWORD)',
), // awkward comma
)
);
To be really consistent, I'd to add another comma, but for me it looks kind of awkward after the closing brace.
What would you think?
@pueppiblue thanks a lot for this contribution. I totally agree with the addition of the missing However, I've reverted the other changes mainly for two reasons:
In any case, thanks for your contribution and we've merged it in 3.4 (later we'll merge it in the other branches). Congrats on your Symfony Docs contribution! |
…o Use PdoSessionHandler..." (pueppiblue, javiereguiluz) This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #9493). Discussion ---------- Document host parameter and external parameters in "How to Use PdoSessionHandler..." I recently had the use case to store sessions via pdo on a docker grid. I noticed the `doctrine/pdo_session_storage.rst` documentation is missing the option to configure a host on the PdoSessionHandler and that the service configuration does not use external environment parameters. - add host parameter to first argument useful when database is on another host e.g. docker grid - wrap parameter values in %env()% - add note how to use external parameters Commits ------- d49d8a7 Remove some unneeded changes a7c3344 Don't use env vars in all config examples 8ea2380 add more trailing comma on last array element #9493 ba5fa52 add trailing comma on last array element #9493 e291746 codestyle cd24113 add documentation for external parameters and pdo host parameter
* 3.4: Remove some unneeded changes Don't use env vars in all config examples add more trailing comma on last array element symfony#9493 add trailing comma on last array element symfony#9493 codestyle add documentation for external parameters and pdo host parameter
* 4.0: Remove some unneeded changes Don't use env vars in all config examples add more trailing comma on last array element symfony#9493 add trailing comma on last array element symfony#9493 codestyle add documentation for external parameters and pdo host parameter
* 4.1: Remove some unneeded changes Don't use env vars in all config examples add more trailing comma on last array element symfony#9493 add trailing comma on last array element symfony#9493 codestyle add documentation for external parameters and pdo host parameter
I recently had the use case to store sessions via pdo on a docker grid.
I noticed the
doctrine/pdo_session_storage.rst
documentation is missing the optionto configure a host on the PdoSessionHandler and that
the service configuration does not use external environment parameters.
useful when database is on another host e.g. docker grid