Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Config] Allow nonexistent file resources#20836
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
xabbuh commentedDec 19, 2016
Not sure if we need this feature. But in this case I'd prefer a new parameter instead of a new resource type. |
julienfalque commentedDec 20, 2016
I'm not sure about adding a parameter. The current behavior is to check that the file still exists before evaluating freshness and return Or maybe |
sstok commentedDec 26, 2016
Maybe a Combined[File]Resource([newFileExistenceResource('phpunit.xml'),newFileResource('phpunit.xml')]); |
julienfalque commentedDec 26, 2016
That would still require changes to Furthermore, having such resource class to combine other resources would be superfluous: the container is recompiled as soon as at least one of its resources is updated, we can simply add both resources from your example to the container directly. |
nicolas-grekas commentedFeb 14, 2017
Closing in favor of#21408 which wraps the required logic and should be the way to go now. |
Updates
FileResourceto also evaluate freshness against file existence.Currently,
FileResourceassumes that the file always exists. I have a use case where this is not necessarily true: for tests purposes, I create aTestKernelclass that usesMicroKernelTraitto define all the configs directly, except some values that are defined inphpunit.xmlandphpunit.xml.distfiles. Since the tests can pass with the default values fromphpunit.xml.dist, creating thephpunit.xmlfile is not required. So inTestKernelI have to do this:Maybe it should be a new class instead, WDYT?