You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, we recently updated from 7.3.1 to 7.3.3 and found that our very "default" cachetool usage stopped working. (The only cachetool config we have set is set('bin/cachetool', 'vendor/bin/cachetool') so use the composer installed version.) The issue was introduced by #3684 – where is caused a loud failure – and then tweaked by cb28eb8 – where it now causes a silent failure.
the empty element is skipped (by the foreach ... if)
an empty array is returned from cachetool_options
task cachetool:clear:opcache iterates over this array, doing nothing because it's empty
Based on the code, it seems that this will affect any of the cachetool:* tasks, as they all iterate over cachetool_options, but I have only experienced it with cachetool:clear:opcache
Workaround
I have found that set('cachetool_args', ' '); is an effective workaround for the time being. Note that it needs the second arg to be a non-empty string of only whitespace.
Possible Fixes
I'm sorry, but I don't have the time or wherewithal to test and submit a fix for this at this time. The options that jump out at me, though, are:
don't cast (array)get('cachetool');, and do if ($options === '') { return [''] }, then cast (array) $options when it's given to the foreach
leave the cast in place, but change the foreach to something like $return[] = empty($option) ? '' : "--fcgi={$option}"
Thank you!
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
We receive the funding once the issue is completed & confirmed by you.
Thank you in advance for helping prioritize & fund our backlog.
Hi, we recently updated from 7.3.1 to 7.3.3 and found that our very "default" cachetool usage stopped working. (The only cachetool config we have set is
set('bin/cachetool', 'vendor/bin/cachetool')so use the composer installed version.) The issue was introduced by #3684 – where is caused a loud failure – and then tweaked by cb28eb8 – where it now causes a silent failure.The issue is that the
cachetoolsetting is''(empty string) by default (see https://github.com/deployphp/deployer/blob/master/contrib/cachetool.php#L50) but the new changes incachetool_options(see diff of 7.3.1...master at v7.3.1...master#diff-3ff1b6689a573050ee941e9cf0474c9f96a4ff7697a386d9c1af6b320fc10ce6) mean that this default value leads to no invocations ofcachetool:cachetoolstarts as''['']foreach ... if)cachetool_optionscachetool:clear:opcacheiterates over this array, doing nothing because it's emptyBased on the code, it seems that this will affect any of the
cachetool:*tasks, as they all iterate overcachetool_options, but I have only experienced it withcachetool:clear:opcacheWorkaround
I have found that
set('cachetool_args', ' ');is an effective workaround for the time being. Note that it needs the second arg to be a non-empty string of only whitespace.Possible Fixes
I'm sorry, but I don't have the time or wherewithal to test and submit a fix for this at this time. The options that jump out at me, though, are:
(array)get('cachetool');, and doif ($options === '') { return [''] }, then cast(array) $optionswhen it's given to the foreachforeachto something like$return[] = empty($option) ? '' : "--fcgi={$option}"Thank you!
Upvote & Fund