summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2013-03-27 03:45:04 (GMT)
committerwebchick2013-03-27 03:45:04 (GMT)
commit32111ed0493579eefb05c5158fb8a6f62a6aa7cd (patch)
tree0364377cdfdd3c34052bcac298692141d792d82f
parent79d1d4c6d62aa673d2ec08909999741bf403a090 (diff)
Issue #1937270 by ACF: Change drupal_css_cache_files() into state.
-rw-r--r--core/includes/common.inc6
-rw-r--r--core/modules/color/lib/Drupal/color/Tests/ColorTest.php2
2 files changed, 4 insertions, 4 deletions
diff --git a/core/includes/common.inc b/core/includes/common.inc
index 60f57f2..fab8fc0 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -3120,7 +3120,7 @@ function drupal_pre_render_styles($elements) {
function drupal_build_css_cache($css) {
$data = '';
$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.
// This prevents new aggregates from being created unnecessarily.
$css_data = array();
@@ -3188,7 +3188,7 @@ function drupal_build_css_cache($css) {
}
// Save the updated map.
$map[$key] = $uri;
- variable_set('drupal_css_cache_files', $map);
+ state()->set('drupal_css_cache_files', $map);
}
return $uri;
}
@@ -3353,7 +3353,7 @@ function _drupal_load_stylesheet($matches) {
* Deletes old cached CSS files.
*/
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'));
}
diff --git a/core/modules/color/lib/Drupal/color/Tests/ColorTest.php b/core/modules/color/lib/Drupal/color/Tests/ColorTest.php
index fea5686..9ddd06a 100644
--- a/core/modules/color/lib/Drupal/color/Tests/ColorTest.php
+++ b/core/modules/color/lib/Drupal/color/Tests/ColorTest.php
@@ -110,7 +110,7 @@ class ColorTest extends WebTestBase {
$config->set('css.preprocess', 1);
$config->save();
$this->drupalGet('<front>');
- $stylesheets = variable_get('drupal_css_cache_files', array());
+ $stylesheets = state()->get('drupal_css_cache_files') ?: array();
$stylesheet_content = '';
foreach ($stylesheets as $key => $uri) {
$stylesheet_content .= join("\n", file(drupal_realpath($uri)));