Clear APCu cache, if installed, after site-install command. #4803
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When re-installing a site, e.g. during local development, caches are not cleared. This makes sense in so far as database tables are dropped prior to install, and so most of Drupal's db-backed caches will be empty by definition. However, the chained fast cache backend uses APCu if present/available. This backend is used by, among other things, the extension list API for storing definitions of installed modules.
This can result in cache data inconsistency when, for instance, modules are excluded from export in
$settings['config_exclude_modules']
. If an excluded module is installed, and then the site re-installed, Drupal will continue to see a modules list from the APCu cache which includes the module, though it wasn't actually installed from config. An edge case for sure, but an edge case nonetheless.This could theoretically extend to other cache backends such as redis/memcached/etc., however I think it makes sense to accommodate for this condition in Drush core because Drupal core itself supports APCu. The other cache backend types are in contrib-land and would thus be reasonable to place on the developer to lifecycle themselves.