Commit 32111ed0 authored by webchick's avatar webchick

Issue #1937270 by ACF: Change drupal_css_cache_files() into state.

parent 79d1d4c6
...@@ -3120,7 +3120,7 @@ function drupal_pre_render_styles($elements) { ...@@ -3120,7 +3120,7 @@ function drupal_pre_render_styles($elements) {
function drupal_build_css_cache($css) { function drupal_build_css_cache($css) {
$data = ''; $data = '';
$uri = ''; $uri = '';
$map = variable_get('drupal_css_cache_files', array()); $map = state()->get('drupal_css_cache_files') ?: array();
// Create a new array so that only the file names are used to create the hash. // Create a new array so that only the file names are used to create the hash.
// This prevents new aggregates from being created unnecessarily. // This prevents new aggregates from being created unnecessarily.
$css_data = array(); $css_data = array();
...@@ -3188,7 +3188,7 @@ function drupal_build_css_cache($css) { ...@@ -3188,7 +3188,7 @@ function drupal_build_css_cache($css) {
} }
// Save the updated map. // Save the updated map.
$map[$key] = $uri; $map[$key] = $uri;
variable_set('drupal_css_cache_files', $map); state()->set('drupal_css_cache_files', $map);
} }
return $uri; return $uri;
} }
...@@ -3353,7 +3353,7 @@ function _drupal_load_stylesheet($matches) { ...@@ -3353,7 +3353,7 @@ function _drupal_load_stylesheet($matches) {
* Deletes old cached CSS files. * Deletes old cached CSS files.
*/ */
function drupal_clear_css_cache() { function drupal_clear_css_cache() {
variable_del('drupal_css_cache_files'); state()->delete('drupal_css_cache_files');
file_scan_directory('public://css', '/.*/', array('callback' => 'drupal_delete_file_if_stale')); file_scan_directory('public://css', '/.*/', array('callback' => 'drupal_delete_file_if_stale'));
} }
......
...@@ -110,7 +110,7 @@ function _testColor($theme, $test_values) { ...@@ -110,7 +110,7 @@ function _testColor($theme, $test_values) {
$config->set('css.preprocess', 1); $config->set('css.preprocess', 1);
$config->save(); $config->save();
$this->drupalGet('<front>'); $this->drupalGet('<front>');
$stylesheets = variable_get('drupal_css_cache_files', array()); $stylesheets = state()->get('drupal_css_cache_files') ?: array();
$stylesheet_content = ''; $stylesheet_content = '';
foreach ($stylesheets as $key => $uri) { foreach ($stylesheets as $key => $uri) {
$stylesheet_content .= join("\n", file(drupal_realpath($uri))); $stylesheet_content .= join("\n", file(drupal_realpath($uri)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment