diff -u b/core/rebuild.php b/core/rebuild.php --- b/core/rebuild.php +++ b/core/rebuild.php @@ -6,10 +6,10 @@ * * Needs a token query argument which can be calculated using the * scripts/rebuild_token_calculator.sh script. + * + * @see drupal_rebuild() */ -use Drupal\Component\PhpStorage\PhpStorageFactory; -use Drupal\Core\Cache\Cache; use Drupal\Component\Utility\Crypt; // Change the directory to the Drupal root. @@ -23,22 +23,7 @@ ((REQUEST_TIME - $_GET['timestamp']) < 300) && ($_GET['token'] === Crypt::hmacBase64($_GET['timestamp'], $GLOBALS['drupal_hash_salt'])) )) { - // drupal_bootstrap(DRUPAL_BOOTSTRAP_KERNEL) will build a new kernel. This - // comes before DRUPAL_BOOTSTRAP_PAGE_CACHE. - PhpStorageFactory::get('service_container')->deleteAll(); - PhpStorageFactory::get('twig')->deleteAll(); - - // Disable the page cache. - drupal_page_is_cacheable(FALSE); - - // Bootstrap up to where caches exist and clear them. - drupal_bootstrap(DRUPAL_BOOTSTRAP_PAGE_CACHE); - foreach (Cache::getBins() as $bin) { - $bin->deleteAll(); - } - - drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); - drupal_flush_all_caches(); + drupal_rebuild(); drupal_set_message('Cache rebuild complete.'); } only in patch2: unchanged: --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -1,5 +1,6 @@ deleteAll(); + PhpStorageFactory::get('twig')->deleteAll(); + + // Disable the page cache. + drupal_page_is_cacheable(FALSE); + + // Bootstrap up to where caches exist and clear them. + drupal_bootstrap(DRUPAL_BOOTSTRAP_PAGE_CACHE); + foreach (Cache::getBins() as $bin) { + $bin->deleteAll(); + } + + drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); + drupal_flush_all_caches(); +} + +/** * Returns the appropriate configuration directory. * * Returns the configuration path based on the site's hostname, port, and