Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[RFC][Config] Split Config component? #7796

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
mpdude opened this issue Apr 22, 2013 · 8 comments
Closed

[RFC][Config] Split Config component? #7796

mpdude opened this issue Apr 22, 2013 · 8 comments
Assignees

Comments

@mpdude
Copy link
Contributor

mpdude commented Apr 22, 2013

If I am not overlooking something, the Config component consists of three things that have little to nothing to do with each other:

  • Configuration definition/validation (in Config/Definition)
  • Configuration loading (in Config/Loader)
  • Caching things in a file on disk with a revalidation mechanism (ConfigCache et. al.)

I came across a PR discussion lately (will try to find it again) in which (Drupal?) folks complained about depending on the Config component IIRC. Not sure whether the dependency itself was a problem or a dependency on too much/wrong stuff, though.

It was just an observation I wanted to log somewhere. If it was a deliberate decision, feel free to close it. Needless to say that'd be a BC break.

@lsmith77
Copy link
Contributor

caching is atm a bit all over the place in Symfony2 and unfortunately we will not have a proper cache component (or blessed 3rd party lib) by 2.3 .. but we can think about what kind of things we could today to prepare for the day when we do have such a thing.

@mpdude
Copy link
Contributor Author

mpdude commented Apr 22, 2013

In the recent discussions about the "Cache component", I had the impression that it mostly aims at having something like Doctrine Cache, APC or the like. ConfigCache is very different from that, but nonetheless it might end up in such a component.

@stof
Copy link
Member

stof commented Apr 22, 2013

@lsmith77 the ConfigCache here is a different thing than the Cache component, with a different use case.

There is a small issue in your description through. the resources are also used by the ConfigCache part. They are not only for loaders.

The main drawback of such a split is the BC break IMO. Otherwise, I'm all in favor of splitting things as the loaders and the Definition stuff are 2 different unrelated features (except for the fact that you will often use a loader to build the array passed to the Configuration)

@mpdude
Copy link
Contributor Author

mpdude commented Apr 22, 2013

The "Resources" (ResourceInterface et al) are not even used by loaders. Loaders only talk about loading "resources", but that's just strings identifying something.

ResourceInterface is for ConfigCache only.

@stof
Copy link
Member

stof commented Apr 22, 2013

Well, resources are handled by the child classes of the loader implementing the actual loading logic, as the way resources are gathered also depend of the case. See the loader implementations in the DI and Routing components.
The loaders are the objects knowing how to build the ResourceInterface instances as they are the only place knowing which file they are reading.

@mpdude
Copy link
Contributor Author

mpdude commented Sep 25, 2015

@stof do you still consider this split worthwhile?

@fabpot
Copy link
Member

fabpot commented Sep 25, 2015

I think it's not worthwhile

@mpdude
Copy link
Contributor Author

mpdude commented Sep 25, 2015

Ok, you guys decide – feel free to close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants