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

Fix ini_get() for boolean values#29041

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
nicolas-grekas merged 1 commit intosymfony:3.4fromdeguif:3.4
Nov 6, 2018
Merged

Conversation

@deguif
Copy link
Contributor

QA
Branch?3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PR

This follows#29020 for branch 3.4

@jvasseur
Copy link
Contributor

jvasseur commentedOct 31, 2018
edited
Loading

This shouldn't be needed,ini_get already returns a normalized value for boolean configs :"" for false and"1" for true (andfalse if the setting doesn't exists).

@ro0NL
Copy link
Contributor

maybe it only happens due ini_set()?https://3v4l.org/flvAL

@nicolas-grekas
Copy link
Member

nicolas-grekas commentedOct 31, 2018
edited
Loading

ini_set() and ENV-defined ini settings, seecomposer/composer#7760 (comment)

@deguif
Copy link
ContributorAuthor

To add more details, the issue is encountered when using environment variables to configure some PHP ini directives.

#php.ini[opcache]opcache.enable_cli = ${PHP_INI_OPCACHE_ENABLE_CLI}

PHP_INI_APC_ENABLE_CLI=true php -r "var_dump(ini_get('apc.enable_cli')); new APCUIterator();" will enable apcu and outputs:

string(4) "true"

PHP_INI_APC_ENABLE_CLI=false php -r "var_dump(ini_get('apc.enable_cli')) ; new APCUIterator();"
will disable apcu and outputs:

string(5) "false"Fatal error: APCuIterator::__construct(): APC must be enabled to use APCuIterator in Command line code on line 1

@fabpot
Copy link
Member

I'm not sure we want to do this dance for all calls toini_get. Most of those settings should not be set via env vars anyway (or is there another case where we need this?).

@nicolas-grekas
Copy link
Member

Let's do it IMHO: that prevents us from wondering about which settings are legit changing via env vars. There is no easy reasoning so we will be wrong at some point in the future. There are only a few calls in the code base also...

fabpot added a commit that referenced this pull requestNov 2, 2018
… EnvVarProcessor (nicolas-grekas)This PR was submitted for the 3.4 branch but it was merged into the 4.2-dev branch instead (closes#29042).Discussion----------[DI] use filter_var() instead of XmlUtils::phpize() in EnvVarProcessor| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -#29041 made me realize that we don't need this dependency on the Config component: `filter_var()` is just fine. This allows using a few more legit values for boolean styles, which are already accepted in php.iniCommits-------ce53261 [DI] use filter_var() instead of XmlUtils::phpize() in EnvVarProcessor
@nicolas-grekas
Copy link
Member

Thank you@deguif.

@nicolas-grekasnicolas-grekas merged commit65b34cb intosymfony:3.4Nov 6, 2018
nicolas-grekas added a commit that referenced this pull requestNov 6, 2018
This PR was merged into the 3.4 branch.Discussion----------Fix ini_get() for boolean values| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |This follows#29020 for branch 3.4Commits-------65b34cb Fix ini_get() for boolean values
@deguifdeguif deleted the 3.4 branchNovember 12, 2018 18:19
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@xabbuhxabbuhxabbuh approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

7 participants

@deguif@jvasseur@ro0NL@nicolas-grekas@fabpot@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp