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

Deprecate mixing the url option with host, dbname and a few others #1335

Merged
merged 1 commit into from
May 26, 2021

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Apr 25, 2021

As proposed in #1331

For discussion. (I'll take care of tests once the discussion has settled.)

@nicolas-grekas nicolas-grekas changed the title Merge pull request #1321 from doctrine/2.3.x-merge-up-into-2.4.x_606b216675c695.74517561 Deprecate some configuration keys in favor of the url one Apr 25, 2021
@ostrolucky
Copy link
Member

You mean #1331, not #1334, right?

@stof I'm not quite sure what you meant with #1331 (comment), is that still a problem in this PR?

I like this PR though, IMO it's ok to finish it.

@nicolas-grekas
Copy link
Member Author

I extracted the part about override_url in #1342 because deprecating the other options requires updating a lot of tests, and also because the discussion should be split apart.

@stof
Copy link
Member

stof commented May 10, 2021

@ostrolucky this PR does not deprecate options like server_version, only the ones corresponding to the standard parts of the URL (the query string being used by DBAL for extra options is something totally specific to DBAL, relying on DBAL option names).
So it can be fine with me.

However, we should be careful when writing the upgrade guide (asking people to dynamically create a URL in the config file from separate username, host, password and db name is quite fragile, as it would probably miss the need for URL escaping, which will only trigger a bug after some time when rotating the password to one using special URL chars for instance)

@ostrolucky
Copy link
Member

Just a reminder that after #1331 has been merged, we expect this to be finished next.

@nicolas-grekas nicolas-grekas changed the title Deprecate some configuration keys in favor of the url one Deprecate mixing the url option with host, dbname and a few others May 26, 2021
@nicolas-grekas
Copy link
Member Author

I went with a more conservative approach that should provide the same benefit:

what is now deprecated is mixing the url option with host, dbname and a few others.

@ostrolucky
Copy link
Member

Yep that's good compromise I think

return $values;
}

$urlConflictingOptions = ['host' => true, 'port' => true, 'user' => true, 'password' => true, 'path' => true, 'dbname' => true, 'unix_socket' => true, 'memory' => true];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think driver is missing, isn't it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

driver is in another branch of the config tree.
I don't think that's an issue.

@ostrolucky ostrolucky added this to the 2.4.0 milestone May 26, 2021
@ostrolucky ostrolucky merged commit f751629 into doctrine:2.4.x May 26, 2021
@ostrolucky
Copy link
Member

thx @nicolas-grekas

@nicolas-grekas nicolas-grekas deleted the deprec-options branch May 26, 2021 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants