diff --git a/core/includes/common.inc b/core/includes/common.inc index e3f405f..6ba0869 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -3216,7 +3216,7 @@ function drupal_pre_render_styles($elements) { function drupal_build_css_cache($css) { $data = ''; $uri = ''; - $map = variable_get('drupal_css_cache_files', array()); + $map = variable_get('preprocess_css_cache_files', array()); // Create a new array so that only the file names are used to create the hash. // This prevents new aggregates from being created unnecessarily. $css_data = array(); @@ -3284,7 +3284,7 @@ function drupal_build_css_cache($css) { } // Save the updated map. $map[$key] = $uri; - variable_set('drupal_css_cache_files', $map); + variable_set('preprocess_css_cache_files', $map); } return $uri; } @@ -3449,7 +3449,7 @@ function _drupal_load_stylesheet($matches) { * Deletes old cached CSS files. */ function drupal_clear_css_cache() { - variable_del('drupal_css_cache_files'); + variable_del('preprocess_css_cache_files'); file_scan_directory('public://css', '/.*/', array('callback' => 'drupal_delete_file_if_stale')); } @@ -3461,8 +3461,8 @@ function drupal_clear_css_cache() { * - drupal_clear_js_cache() */ function drupal_delete_file_if_stale($uri) { - // Default stale file threshold is 30 days. - if (REQUEST_TIME - filemtime($uri) > variable_get('drupal_stale_file_threshold', 2592000)) { + // Default stale file threshold is 3 days. + if (REQUEST_TIME - filemtime($uri) > variable_get('drupal_stale_file_threshold', 259200)) { file_unmanaged_delete($uri); } } @@ -4029,7 +4029,7 @@ function drupal_pre_render_scripts($elements) { // Since JavaScript may look for arguments in the URL and act on them, some // third-party code might require the use of a different query string. - $js_version_string = variable_get('drupal_js_version_query_string', 'v='); + $js_version_string = variable_get('js_version_query_string', 'v='); // Defaults for each SCRIPT element. $element_defaults = array( @@ -4745,7 +4745,7 @@ function drupal_add_tabledrag($table_id, $action, $relationship, $group, $subgro function drupal_build_js_cache($files) { $contents = ''; $uri = ''; - $map = variable_get('drupal_js_cache_files', array()); + $map = variable_get('preprocess_js_cache_files', array()); // Create a new array so that only the file names are used to create the hash. // This prevents new aggregates from being created unnecessarily. $js_data = array(); @@ -4790,7 +4790,7 @@ function drupal_build_js_cache($files) { } } $map[$key] = $uri; - variable_set('drupal_js_cache_files', $map); + variable_set('preprocess_js_cache_files', $map); } return $uri; } @@ -4800,7 +4800,7 @@ function drupal_build_js_cache($files) { */ function drupal_clear_js_cache() { variable_del('javascript_parsed'); - variable_del('drupal_js_cache_files'); + variable_del('preprocess_js_cache_files'); file_scan_directory('public://js', '/.*/', array('callback' => 'drupal_delete_file_if_stale')); } diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php index b43e3fb..0d54c35 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php @@ -334,11 +334,11 @@ class JavaScriptTest extends WebTestBase { )); // Store the expected key for the first item in the cache. - $cache = array_keys(variable_get('drupal_js_cache_files', array())); + $cache = array_keys(variable_get('preprocess_js_cache_files', array())); $expected_key = $cache[0]; // Reset variables and add a file in a different scope first. - variable_del('drupal_js_cache_files'); + variable_del('preprocess_js_cache_files'); drupal_static_reset('drupal_add_js'); drupal_add_js('some/custom/javascript_file.js', array('scope' => 'footer')); drupal_add_js('core/misc/ajax.js'); @@ -352,7 +352,7 @@ class JavaScriptTest extends WebTestBase { )); // Compare the expected key for the first file to the current one. - $cache = array_keys(variable_get('drupal_js_cache_files', array())); + $cache = array_keys(variable_get('preprocess_js_cache_files', array())); $key = $cache[0]; $this->assertEqual($key, $expected_key, 'JavaScript aggregation is not affected by ordering in different scopes.'); }