Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

[DI] allow "." and "-" in env processor lines#35029

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromnicolas-grekas:di-extra-chr
Dec 19, 2019

Conversation

nicolas-grekas
Copy link
Member

QA
Branch?master
Bug fix?no
New feature?yes
Deprecations?no
TicketsFix#34864
LicenseMIT
Doc PR-

As explained in the linked issue, this is especially usefull with thekey processor.

throw new InvalidArgumentException(sprintf('Invalid %s name: only "word" characters are allowed.', $name));
}
if ($this->has($name) && null !== ($defaultValue = parent::get($name)) && !\is_string($defaultValue)) {
throw new RuntimeException(sprintf('The default value of an env() parameter must be a string or null, but "%s" given to "%s".', \gettype($defaultValue), $name));
}

$uniqueName = md5($name.'_'.self::$counter++);
$placeholder = sprintf('%s_%s_%s', $this->getEnvPlaceholderUniquePrefix(),str_replace(':', '_', $env), $uniqueName);
$placeholder = sprintf('%s_%s_%s', $this->getEnvPlaceholderUniquePrefix(),strtr($env, ':-.', '___'), $uniqueName);
Copy link
Member

Choose a reason for hiding this comment

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

replacing the 3 chars with the same replacement will be an issue: we can have multiple env lines producing the same placeholder, which will go wrong when reverting them.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

There is an md5 on the line before that will prevent any collisions from happening.

Copy link
Member

Choose a reason for hiding this comment

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

ah indeed. I missed that.

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

fabpot added a commit that referenced this pull requestDec 19, 2019
…-grekas)This PR was merged into the 5.1-dev branch.Discussion----------[DI] allow "." and "-" in env processor lines| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| Deprecations? | no| Tickets       |Fix#34864| License       | MIT| Doc PR        | -As explained in the linked issue, this is especially usefull with the `key` processor.Commits-------231c505 [DI] allow "." and "-" in env processor lines
@fabpotfabpot merged commit231c505 intosymfony:masterDec 19, 2019
@nicolas-grekasnicolas-grekas deleted the di-extra-chr branchJanuary 4, 2020 14:50
@nicolas-grekasnicolas-grekas modified the milestones:next,5.1May 4, 2020
@fabpotfabpot mentioned this pull requestMay 5, 2020
nicolas-grekas added a commit that referenced this pull requestOct 13, 2020
This PR was merged into the 4.4 branch.Discussion----------[DI] fix dumping env vars| Q             | A| ------------- | ---| Branch?       | 4.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       | -| License       | MIT| Doc PR        | -Forgotten in#35029For 4.4 to reduce merge conflicts (it doesn't allow the new chars in 4.4 anyway,#35029 is still needed)Commits-------746a8d1 [DI] fix dumping env vars
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@fabpotfabpotfabpot approved these changes

@stofstofstof approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
5.1
Development

Successfully merging this pull request may close these issues.

[Dependency Injection] - Invalid env(p-redis-osb) name: only "word" characters are allowed.
5 participants
@nicolas-grekas@fabpot@stof@SimonHeimberg@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp