Problem/Motivation
drupal_rebuild() does
// Force kernel to rebuild php cache.
PhpStorageFactory::get('twig')->deleteAll();
// Invalidate the container.
$kernel->invalidateContainer();
and
foreach (Cache::getBins() as $bin) {
$bin->deleteAll();
}
all of this is done by drupal_flush_all_caches() which it calls.
Also
// Disable recording of cached pages.
\Drupal::service('page_cache_kill_switch')->trigger();
is called before drupal_flush_all_caches(); which seems wrong.
Proposed resolution
Fix it and try and add a test for it.
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Comments
Comment #2
alexpottComment #3
alexpottOne question I guess is are there situations that doing this prior to drupal_flush_all_caches() are we fixing somethings will break if we just rely on drupal_flush_all_caches()
Comment #4
dawehnerThis sounds like a duplicate of #2160091: drupal_rebuild() rebuilds container twice, since drupal_flush_all_caches() also rebuilds it doesn't it?
Comment #5
alexpottYeah totally. Thanks @dawehner :)