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

[FrameworkBundle] added new parameter router.request_context.url#35580

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

Closed
pyatnitsev wants to merge3 commits intosymfony:masterfrompyatnitsev:issue/35121
Closed

[FrameworkBundle] added new parameter router.request_context.url#35580

pyatnitsev wants to merge3 commits intosymfony:masterfrompyatnitsev:issue/35121

Conversation

pyatnitsev
Copy link

The router.request_context.url can be used instead of router.request_context / router.request_context.host etc to define url in console commands

QA
Branch?master
Bug fix?no
New feature?yes
Deprecations?no
TicketsFix#35121
LicenseMIT
Doc PRwill be created after review

The router.request_context.url can be used instead of router.request_context / router.request_context.host etc to define url in console commands
@@ -489,6 +489,7 @@ private function addRouterSection(ArrayNodeDefinition $rootNode)
->scalarNode('host')->defaultValue('%router.request_context.host%')->end()
->scalarNode('scheme')->defaultValue('%router.request_context.scheme%')->end()
->scalarNode('base_url')->defaultValue('%router.request_context.base_url%')->end()
->scalarNode('url')->defaultValue('%router.request_context.url%')->end()
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a config validation to check if this or others are filled but not both? To avoid « conflict »?

Also what about deprecating others if it does the same?

ro0NL reacted with thumbs up emoji
Copy link
Author

Choose a reason for hiding this comment

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

It's a good question.

In this PR url syntax will override "standard" one. Validation may be useful too.
I think, that deprication is not needed, becouse old syntax can be useful. For example, user can pass only base_url.

@ro0NL
Copy link
Contributor

didnt we solve it with#35281 already?

Im not sure introducing more params is for the better, as we moved to semantic config.

Is theurl node really preferred? Isnt it fine to configure thehost/scheme/base_url nodes as-is :/

@nicolas-grekasnicolas-grekas added this to thenext milestoneFeb 4, 2020
@pyatnitsev
Copy link
Author

@ro0NL, url node is not prefered, but it useful for some developers I see. Configure of host / sheme / base url is fine, and url is just a new way todo it. Shortcut in a way.

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment
edited
Loading

Choose a reason for hiding this comment

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

Thanks for working on this.
I would suggest two non-trivial changes here:

  • we should support only the new "base_uri" option in the config - let's drop the 3 others
  • the parameter should be read at runtime, to make it compatible with env vars. This means it cannot be processed in a compiler pass, but where the value is needed at runtime.
    Up to give it a try?

@pyatnitsev
Copy link
Author

@nicolas-grekas, thanks for you review.

Do you have any idea, how to make it compatible with env vars? I understand, way with comliler pass, but how I can do that with envs? Can you give me a more detailed way?

@pyatnitsev
Copy link
Author

and by the way ... if I drop 3 others options... I will be BC break isn't it?

@nicolas-grekas
Copy link
Member

The options are new to master so they can be dropped if I recall correctly.
For the runtime logic, you should look where the parameters are used currently, and make this part able to deal with the new "base_uri".
I can't help more right now sorry.

@pyatnitsev
Copy link
Author

pyatnitsev commentedFeb 4, 2020
edited
Loading

Ok, will try. Thanks a lot.

@nicolas-grekas
Copy link
Member

Friendly ping@pyatnitsev

@pyatnitsev
Copy link
Author

Thank you for ping. I'll try to do this on this weekend.

@nicolas-grekas
Copy link
Member

Thank for opening@pyatnitsev, I took over in#36651

fabpot added a commit that referenced this pull requestMay 4, 2020
…RI with a DSN (nicolas-grekas)This PR was merged into the 5.1-dev branch.Discussion----------[FrameworkBundle] Allow configuring the default base URI with a DSN| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| Deprecations? | no| Tickets       |Fixes#35121, replaces#35580, partially reverts#35281| License       | MIT| Doc PR        | -Instead of defining 3-4 parameters, this PR enables using a single DSN to configure the default URL context (for commands mainly):```framework:router:base_uri: 'https://my.host:8443/base-path/'```When using parameters directly, one can now set the same absolute URI in the `router.request_context.base_url` parameter, this will provide the same benefit.Commits-------250fa7e [FrameworkBundle] Allow configuring the default base URI with a DSN
@nicolas-grekasnicolas-grekas modified the milestones:next,5.1May 4, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@OskarStarkOskarStarkOskarStark left review comments

@noniagriconomienoniagriconomienoniagriconomie left review comments

Assignees
No one assigned
Projects
None yet
Milestone
5.1
Development

Successfully merging this pull request may close these issues.

[FrameworkBundle] URL for setting the request context
6 participants
@pyatnitsev@ro0NL@nicolas-grekas@OskarStark@noniagriconomie@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp