diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 4f848ce..f15cdc6 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -518,6 +518,15 @@ function system_requirements($phase) { ); } $requirements['update status']['title'] = t('Update notifications'); + + if (settings()->get('rebuild_access')) { + $requirements['rebuild access'] = array( + 'title' => t('Rebuild access'), + 'value' => t('Enabled'), + 'severity' => REQUIREMENT_ERROR, + 'description' => t('The rebuild_access setting is enabled in settings.php. It is recommended to have this setting disabled unless you are performing a rebuild.'), + ); + } } // Ensure that if upgrading from 7 to 8 we have no disabled modules. diff --git a/core/rebuild.php b/core/rebuild.php index 4a83715..597361e 100644 --- a/core/rebuild.php +++ b/core/rebuild.php @@ -27,7 +27,9 @@ // comes before DRUPAL_BOOTSTRAP_PAGE_CACHE. PhpStorageFactory::get('service_container')->deleteAll(); PhpStorageFactory::get('twig')->deleteAll(); - $GLOBALS['conf']['system.performance']['cache.page.use_internal'] = FALSE; + + // Disable the page cache. + drupal_page_is_cacheable(FALSE); // Bootstrap up to where caches exist and clear them. drupal_bootstrap(DRUPAL_BOOTSTRAP_PAGE_CACHE); diff --git a/core/scripts/rebuild_token_calculator.sh b/core/scripts/rebuild_token_calculator.sh index e9d8832..9b948b4 100755 --- a/core/scripts/rebuild_token_calculator.sh +++ b/core/scripts/rebuild_token_calculator.sh @@ -14,7 +14,7 @@ drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION); -if (PHP_SAPI !== 'cli') { +if (!drupal_is_cli()) { exit; } diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php index 0574b23..b3c54b3 100644 --- a/sites/default/default.settings.php +++ b/sites/default/default.settings.php @@ -502,6 +502,16 @@ # $settings['maintenance_theme'] = 'bartik'; /** + * Enable access to rebuild.php. + * + * This setting can be enabled to allow Drupal's php and database cached + * storage to be cleared via the rebuild.php page. Access to this page can also + * be gained by generating a query string from rebuild_token_calculator.sh and + * using these parameters in a request to rebuild.php. + */ +# $settings['rebuild_access'] = TRUE; + +/** * Base URL (optional). * * If Drupal is generating incorrect URLs on your site, which could