diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/bootstrap.inc | 18 | ||||
-rw-r--r-- | includes/common.inc | 2 | ||||
-rw-r--r-- | includes/form.inc | 2 | ||||
-rw-r--r-- | includes/language.inc | 2 |
4 files changed, 7 insertions, 17 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 0b79f91a0..d18564462 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -49,16 +49,6 @@ define('CACHE_PERMANENT', 0); define('CACHE_TEMPORARY', -1); /** - * Indicates that page caching is disabled. - */ -define('CACHE_DISABLED', 0); - -/** - * Indicates that page caching is enabled, using "normal" mode. - */ -define('CACHE_NORMAL', 1); - -/** * Log message severity -- Emergency: system is unusable. * * @see watchdog() @@ -1096,7 +1086,7 @@ function drupal_serve_page_from_cache(stdClass $cache) { // do not bother caching the page in a public proxy, because the cached copy // will only be served to that particular user due to Vary: Cookie, unless // the Vary header has been replaced or unset in hook_boot() (see below). - $max_age = !variable_get('page_cache_invoke_hooks', TRUE) && (!isset($_COOKIE[session_name()]) || isset($hook_boot_headers['vary'])) ? variable_get('cache_lifetime', 0) : 0; + $max_age = !variable_get('page_cache_invoke_hooks', TRUE) && (!isset($_COOKIE[session_name()]) || isset($hook_boot_headers['vary'])) ? variable_get('page_cache_maximum_age', 0) : 0; $default_headers['Cache-Control'] = 'public, max-age=' . $max_age; // Entity tag should change if the output changes. @@ -1982,16 +1972,16 @@ function _drupal_bootstrap_page_cache() { } // Check for a cache mode force from settings.php. if (variable_get('page_cache_without_database')) { - $cache_mode = CACHE_NORMAL; + $cache_enabled = TRUE; } else { drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES, FALSE); - $cache_mode = variable_get('cache'); + $cache_enabled = variable_get('cache'); } drupal_block_denied(ip_address()); // If there is no session cookie and cache is enabled (or forced), try // to serve a cached page. - if (!isset($_COOKIE[session_name()]) && $cache_mode == CACHE_NORMAL) { + if (!isset($_COOKIE[session_name()]) && $cache_enabled) { // Make sure there is a user object because it's timestamp will be // checked, hook_boot might check for anonymous user etc. $user = drupal_anonymous_user(); diff --git a/includes/common.inc b/includes/common.inc index bfae48bf8..7f1cae77d 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -2431,7 +2431,7 @@ function drupal_page_footer() { // Commit the user session, if needed. drupal_session_commit(); - if (variable_get('cache', CACHE_DISABLED) != CACHE_DISABLED && ($cache = drupal_page_set_cache())) { + if (variable_get('cache', 0) && ($cache = drupal_page_set_cache())) { drupal_serve_page_from_cache($cache); } else { diff --git a/includes/form.inc b/includes/form.inc index cc2445108..757228743 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -651,7 +651,7 @@ function drupal_process_form($form_id, &$form, &$form_state) { // We'll clear out the cached copies of the form and its stored data // here, as we've finished with them. The in-memory copies are still // here, though. - if (variable_get('cache', CACHE_DISABLED) == CACHE_DISABLED && !empty($form_state['values']['form_build_id'])) { + if (!variable_get('cache', 0) && !empty($form_state['values']['form_build_id'])) { cache_clear_all('form_' . $form_state['values']['form_build_id'], 'cache_form'); cache_clear_all('storage_' . $form_state['values']['form_build_id'], 'cache_form'); } diff --git a/includes/language.inc b/includes/language.inc index 43a4961a0..908f013fd 100644 --- a/includes/language.inc +++ b/includes/language.inc @@ -283,7 +283,7 @@ function language_provider_invoke($provider_id, $provider = NULL) { // If the language provider has no cache preference or this is satisfied // we can execute the callback. - $cache = !isset($provider['cache']) || $user->uid || $provider['cache'] == variable_get('cache', CACHE_DISABLED); + $cache = !isset($provider['cache']) || $user->uid || $provider['cache'] == variable_get('cache', 0); $callback = isset($provider['callbacks']['language']) ? $provider['callbacks']['language'] : FALSE; $langcode = $cache && function_exists($callback) ? $callback($languages) : FALSE; $results[$provider_id] = isset($languages[$langcode]) ? $languages[$langcode] : FALSE; |