-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support for database URLs #729
Conversation
Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DBAL-1050 We use Jira to track the state of pull requests and the versions they got |
* URL extracted into indidivual parameter parts. | ||
* | ||
*/ | ||
private static function _parseDatabaseUrl(array $params) |
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.
doesn't need to be prefixed with _
anymore (was an old convention)
Also required for this PR: documentation changes in |
@dzuelke Can you add a paragraph to |
The four slashes look quite strange in my eyes. What I want to say: That looks unusual and unintuitive to me. Why don't you simply use DSN?
Anyway: Like to see this merged (in any form), because I find it annoying to have all this parameters for a single connection 😄 |
@kingcrunch This is modelled after URIs that IaaS services provide on various platforms, i.e. Amazon RDS, Heroku and so on. This allows developers to use what is provided without further parsing. |
Now I could ask, why they used this format instead of DSNs, but that would go to far 😉 I'm convinced (not, that it matters somehow) |
@dzuelke thanks,merged |
🚀 |
With a bunch of tests.
Of note:
sqlite:///relativepath.db
orsqlite://ignoredhost/relativepath.db
for relative, andsqlite:////tmp/absolutepath.db
orsqlite://ignoredhost//tmp/absolutepath.db
for absolute paths to the database file (I went back and forth on this, but this way is easier and more consistent; https://github.com/kennethreitz/dj-database-url does the same)$params
verbatim; makes sense IMO especially considering point number 1