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

[DependencyInjection] Add an env function to DI expression language#45450

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:6.1fromjvasseur:expr-env
Feb 18, 2022

Conversation

@jvasseur
Copy link
Contributor

@jvasseurjvasseur commentedFeb 16, 2022
edited by nicolas-grekas
Loading

QA
Branch?6.1
Bug fix?no
New feature?yes
Deprecations?no
Tickets
LicenseMIT
Doc PRsymfony/symfony-docs#16518

This add anenv function to the DI expression language provider to ease creating expressions that depends on an environment variable.

thrownewLogicException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');
}
$this->expressionLanguage =newExpressionLanguage(null,$this->expressionLanguageProviders);
$this->expressionLanguage =newExpressionLanguage(null,$this->expressionLanguageProviders,null, \Closure::fromCallable([$this,'getEnv']));
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

This is the only way I found to allow the expression language to fetch an env variable outside of a dumped container because of thegetEnv visibility but maybe we could make the method public instead.

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.

Nice, I like it :)

@carsonbotcarsonbot changed the titleAdd an env function to DI expression language[DependencyInjection] Add an env function to DI expression languageFeb 18, 2022
@nicolas-grekas
Copy link
Member

Thank you@jvasseur.

@nicolas-grekasnicolas-grekas merged commit65b7fa1 intosymfony:6.1Feb 18, 2022
@jvasseurjvasseur deleted the expr-env branchFebruary 18, 2022 10:23
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull requestMar 11, 2022
…xpression function (jvasseur)This PR was merged into the 6.1 branch.Discussion----------[DependencyInjection] Add documentation for the env DI expression functionDoc PR forsymfony/symfony#45450Commits-------bcbf1f3 Add documentation for the env DI expresion function
@fabpotfabpot mentioned this pull requestApr 15, 2022
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

Assignees

No one assigned

Projects

None yet

Milestone

6.1

Development

Successfully merging this pull request may close these issues.

3 participants

@jvasseur@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp