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

[Runtime] Possibility to define the env and/or debug key#41608

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:5.4frommaxhelias:env-debug-key
Sep 27, 2021

Conversation

@maxhelias
Copy link
Contributor

@maxheliasmaxhelias commentedJun 8, 2021
edited
Loading

QA
Branch?5.4
Bug fix?no
New feature?yes
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

As theDotenv class allows to choose theenvKey and thedebugKey, it could be interesting to be able to modify it also via the Runtime component.

Example :

$_SERVER['APP_RUNTIME_OPTIONS'] = [    'env_var_names' => [        'env_key' => 'ENV_MODE',        'debug_key' => 'DEBUG_MODE',    ],];

@nicolas-grekas
Copy link
Member

Do you have a use case? If yes can you explain it? If not, better leave this as is IMHO.

@maxhelias
Copy link
ContributorAuthor

On many of our projects, clients want to redefine the names of variables or prefix them with the name of their application.
It's always possible to create a custom runtime to work around this, but that requires a lot of override and I'm afraid that we lose the interest of the component.

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

Thanks for the details.

@javiereguiluz
Copy link
Member

This feature looks reasonable 👍 but I don't like much the names of these options --> "envKey" and "debugKey" To me they sound like some secret key or token related to the environment of the application.

Here's a proposal for your consideration:

// Before$_SERVER['APP_RUNTIME_OPTIONS'] = ['envKey' =>'ENV_MODE','debugKey' =>'DEBUG_MODE',];// After$_SERVER['APP_RUNTIME_OPTIONS'] = ['envVarNames' => ['env' =>'ENV_MODE','debug' =>'DEBUG_MODE',    ],];
apfelbox, Nyholm, and chapterjason reacted with thumbs up emoji

@maxhelias
Copy link
ContributorAuthor

@nicolas-grekas@javiereguiluz what do I do? Which modification do I apply?

@rosier
Copy link
Contributor

rosier commentedJun 16, 2021
edited
Loading

My suggestion is mainly about using snake_case consistent. How about combining that with the proposal of@javiereguiluz into:

$_SERVER['APP_RUNTIME_OPTIONS'] = [    'env_var_names' => [        'env' => 'ENV_MODE',        'debug' => 'DEBUG_MODE',    ],];

@maxhelias
Copy link
ContributorAuthor

Status: Needs Review

@fabpot
Copy link
Member

Thank you@maxhelias.

@maxheliasmaxhelias deleted the env-debug-key branchSeptember 27, 2021 12:18
fabpot added a commit that referenced this pull requestSep 27, 2021
This PR was merged into the 5.4 branch.Discussion----------[Runtime] tweak config for env var names| Q             | A| ------------- | ---| Branch?       | 5.4| Bug fix?      | no| New feature?  | no| Deprecations? | no| Tickets       | -| License       | MIT| Doc PR        | -Tweaking#41608Commits-------c4ef4d7 [Runtime] tweak config for env var names
This was referencedNov 5, 2021
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

@fabpotfabpotfabpot approved these changes

@chalasrchalasrchalasr approved these changes

+1 more reviewer

@rosierrosierrosier left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

7 participants

@maxhelias@nicolas-grekas@javiereguiluz@rosier@fabpot@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp