Ability to disable cache:clear_php_http #17
-
Hello! I use your deployer-extended-typo3 package which, in turn, uses this calls In some instances I don't want this to be called - if the site is behind a http auth or if it doesn't have a live URL yet, however the only way I can disable it is by overwriting the whole function with task('cache:clear_php_http', function () {
}); In the times I don't want it, I don't want to have to redeclare the whole Thanks, as always, for all the work! |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
I was thinking the same in past. But for setting the disable flag you would anyway need to use a one line code like: For deployer 7.* you can however just do: I am not sure there can be anything simpler. A flag for that would be making things more complex where there is no need to. |
Beta Was this translation helpful? Give feedback.
-
My use-case is that I have a central package which includes yours and sets a few defaults which we use on all of our projects. As some of our projects are behind http auth, I disabled the My issue arose when I wanted the task to fire for one of my projects, so a flag would be preferable (especially if it could be set per environment). For now, I have redefined the on(select('instance=production'), function ($host) {
after('cache:clear_php_cli', 'cache:clear_php_http');
}); The downside now is that if you add a new task, I don't benefit from it. I appreciate this is an edge case and is obviously not a common problem as no-one else has reported it :) My preference would be for it to run if |
Beta Was this translation helpful? Give feedback.
-
What about:
and then where you define host
|
Beta Was this translation helpful? Give feedback.
-
@kszymukowicz Yeah, that works :) |
Beta Was this translation helpful? Give feedback.
-
Hey @kszymukowicz, what do you think about the possibility to make it possible to configure basic auth credentials? I have the same problem: a staging system, so the cache:clear_php_http fails. It would be possible to pass the credentials to wget: wget --user user --password pass http://example.com/ Best regards |
Beta Was this translation helpful? Give feedback.
-
Sure! |
Beta Was this translation helpful? Give feedback.
-
I just had a look at the code. There is already a possibility for wget and curl: host('staging')
->set('fetch_method_wget_options', '--user user --password password') For Unfortunately, I don't have the time to get to grips with this at the moment. |
Beta Was this translation helpful? Give feedback.
What about:
task('cache:clear_php_http')->select('cache_clear_php_http_task_disable!=true');
and then where you define host