Skip to content

Access from a non-request scope (like Commands) to values stored on request-restricted services (like assets_version) #9185

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gnutix opened this issue Oct 1, 2013 · 2 comments

Comments

@gnutix
Copy link
Contributor

gnutix commented Oct 1, 2013

Today, I needed to access the "templating.framework.assets_version" value from a Command. Here's the result: https://gist.github.com/gnutix/6775868

I don't think it's a good way to go, and after a quick talk with @lsmith77, it seems like there's a lot of similar case where you may want to access a configuration value that has been stored only on a service restricted to the request scope.

This issue's goal is to list those use cases, and try to come up with a nice solution for them (rather than entering/leaving the request scope manually).

Any input is very welcomed.

Registered use cases

  • templating.framework.assets_version
@fabpot
Copy link
Member

fabpot commented Oct 9, 2013

#9251 would solve the problem in 2.4 as the request scope won't be used anymore in the core framework.

@gnutix
Copy link
Contributor Author

gnutix commented Oct 9, 2013

Seems good! :)

@gnutix gnutix closed this as completed Oct 9, 2013
fabpot added a commit that referenced this issue Dec 31, 2013
…on the request service (fabpot)

This PR was merged into the 2.5-dev branch.

Discussion
----------

[WIP] [FrameworkBundle] removed some more dependencies on the request service

| Q             | A
| ------------- | ---
| Bug fix?      | kinda (see linked tickets)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #8915, #9185
| License       | MIT
| Doc PR        | n/a

/cc @kriswallsmith

Commits
-------

4f3d502 [FrameworkBundle] removed some more dependencies on the request service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants