summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/locale/locale.api.php2
-rw-r--r--modules/locale/locale.module2
-rw-r--r--modules/poll/poll.test2
-rw-r--r--modules/simpletest/tests/bootstrap.test10
-rw-r--r--modules/simpletest/tests/session.test2
-rw-r--r--modules/system/system.admin.inc19
-rw-r--r--modules/system/system.install2
7 files changed, 23 insertions, 16 deletions
diff --git a/modules/locale/locale.api.php b/modules/locale/locale.api.php
index 488b2bbed..f39379e66 100644
--- a/modules/locale/locale.api.php
+++ b/modules/locale/locale.api.php
@@ -151,7 +151,7 @@ function hook_language_negotiation_info() {
'types' => array('custom_language_type'),
'name' => t('Custom language provider'),
'description' => t('This is a custom language provider.'),
- 'cache' => CACHE_DISABLED,
+ 'cache' => 0,
),
);
}
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index 4c58a8e00..e122b9f93 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -589,7 +589,7 @@ function locale_language_negotiation_info() {
'callbacks' => array('language' => 'locale_language_from_browser'),
'file' => $file,
'weight' => -2,
- 'cache' => CACHE_DISABLED,
+ 'cache' => 0,
'name' => t('Browser'),
'description' => t("Determine the language from the browser's language settings."),
);
diff --git a/modules/poll/poll.test b/modules/poll/poll.test
index 365a1861d..32ffd75bc 100644
--- a/modules/poll/poll.test
+++ b/modules/poll/poll.test
@@ -375,7 +375,7 @@ class PollVoteCheckHostname extends PollTestCase {
// Enable page cache to verify that the result page is not saved in the
// cache when anonymous voting is allowed.
- variable_set('cache', CACHE_NORMAL);
+ variable_set('cache', 1);
// Create poll.
$title = $this->randomName();
diff --git a/modules/simpletest/tests/bootstrap.test b/modules/simpletest/tests/bootstrap.test
index 9ab2c8382..043cc4a3a 100644
--- a/modules/simpletest/tests/bootstrap.test
+++ b/modules/simpletest/tests/bootstrap.test
@@ -105,7 +105,7 @@ class BootstrapPageCacheTestCase extends DrupalWebTestCase {
* Test support for requests containing If-Modified-Since and If-None-Match headers.
*/
function testConditionalRequests() {
- variable_set('cache', CACHE_NORMAL);
+ variable_set('cache', 1);
// Fill the cache.
$this->drupalGet('');
@@ -143,7 +143,7 @@ class BootstrapPageCacheTestCase extends DrupalWebTestCase {
* Test cache headers.
*/
function testPageCache() {
- variable_set('cache', CACHE_NORMAL);
+ variable_set('cache', 1);
// Fill the cache.
$this->drupalGet('system-test/set-header', array('query' => array('name' => 'Foo', 'value' => 'bar')));
@@ -187,7 +187,7 @@ class BootstrapPageCacheTestCase extends DrupalWebTestCase {
* mod_deflate Apache module.
*/
function testPageCompression() {
- variable_set('cache', CACHE_NORMAL);
+ variable_set('cache', 1);
// Fill the cache and verify that output is compressed.
$this->drupalGet('', array(), array('Accept-Encoding: gzip,deflate'));
@@ -280,14 +280,14 @@ class HookBootExitTestCase extends DrupalWebTestCase {
*/
function testHookBootExit() {
// Test with cache disabled. Boot and exit should always fire.
- variable_set('cache', CACHE_DISABLED);
+ variable_set('cache', 0);
$this->drupalGet('');
$calls = 1;
$this->assertEqual(db_query('SELECT COUNT(*) FROM {watchdog} WHERE type = :type AND message = :message', array(':type' => 'system_test', ':message' => 'hook_boot'))->fetchField(), $calls, t('hook_boot called with disabled cache.'));
$this->assertEqual(db_query('SELECT COUNT(*) FROM {watchdog} WHERE type = :type AND message = :message', array(':type' => 'system_test', ':message' => 'hook_exit'))->fetchField(), $calls, t('hook_exit called with disabled cache.'));
// Test with normal cache. Boot and exit should be called.
- variable_set('cache', CACHE_NORMAL);
+ variable_set('cache', 1);
$this->drupalGet('');
$calls++;
$this->assertEqual(db_query('SELECT COUNT(*) FROM {watchdog} WHERE type = :type AND message = :message', array(':type' => 'system_test', ':message' => 'hook_boot'))->fetchField(), $calls, t('hook_boot called with normal cache.'));
diff --git a/modules/simpletest/tests/session.test b/modules/simpletest/tests/session.test
index 7caecbe98..1b74405fd 100644
--- a/modules/simpletest/tests/session.test
+++ b/modules/simpletest/tests/session.test
@@ -140,7 +140,7 @@ class SessionTestCase extends DrupalWebTestCase {
$this->assertSessionEmpty(TRUE);
// The same behavior is expected when caching is enabled.
- variable_set('cache', CACHE_NORMAL);
+ variable_set('cache', 1);
$this->drupalGet('');
$this->assertSessionCookie(FALSE);
$this->assertSessionEmpty(TRUE);
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 3f386d8ab..a681d74a8 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -1622,12 +1622,12 @@ function system_performance_settings() {
'#title' => t('Caching'),
);
- $cache = variable_get('cache', CACHE_DISABLED);
+ $cache = variable_get('cache', 0);
$form['caching']['cache'] = array(
- '#type' => 'radios',
- '#title' => t('Page cache for anonymous users'),
+ '#type' => 'checkbox',
+ '#title' => t('Cache pages for anonymous users'),
'#default_value' => $cache,
- '#options' => array(CACHE_DISABLED => t('Disabled'), CACHE_NORMAL => t('Normal (recommended)')),
+ '#weight' => -2,
);
$period = drupal_map_assoc(array(0, 60, 180, 300, 600, 900, 1800, 2700, 3600, 10800, 21600, 32400, 43200, 86400), 'format_interval');
$period[0] = '<' . t('none') . '>';
@@ -1636,7 +1636,14 @@ function system_performance_settings() {
'#title' => t('Minimum cache lifetime'),
'#default_value' => variable_get('cache_lifetime', 0),
'#options' => $period,
- '#description' => t('The minimum amount of time that will elapse before the caches are recreated.')
+ '#description' => t('Cached pages will not be re-created until at least this much time has elapsed.')
+ );
+ $form['caching']['page_cache_maximum_age'] = array(
+ '#type' => 'select',
+ '#title' => t('Expiration of cached pages'),
+ '#default_value' => variable_get('page_cache_maximum_age', 0),
+ '#options' => $period,
+ '#description' => t('The maximum time an external cache can use an old version of a page.')
);
$directory = 'public://';
@@ -1653,7 +1660,7 @@ function system_performance_settings() {
'#description' => t('External resources can be optimized automatically, which can reduce both the size and number of requests made to your website.') . $disabled_message,
);
- $js_hide = $cache == CACHE_DISABLED ? ' class="js-hide"' : '';
+ $js_hide = $cache ? '' : ' class="js-hide"';
$form['bandwidth_optimization']['page_compression'] = array(
'#type' => 'checkbox',
'#title' => t('Compress cached pages.'),
diff --git a/modules/system/system.install b/modules/system/system.install
index dd636c843..b12757c7a 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -1995,7 +1995,7 @@ function system_update_7032() {
*/
function system_update_7033() {
if (variable_get('cache') == 2) {
- variable_set('cache', CACHE_NORMAL);
+ variable_set('cache', 1);
return t('Aggressive caching was disabled and replaced with normal caching. Read the page caching section in default.settings.php for more information on how to enable similar functionality.');
}
}