_drupal_flush_css_js

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

includes/common.inc, строка 3682

Версии
6
_drupal_flush_css_js()

Helper function to change query-strings on css/js files.

Changes the character added to all css/js files as dummy query-string, so that all browsers are forced to reload fresh files. We keep 20 characters history (FIFO) to avoid repeats, but only the first (newest) character is actually used on urls, to keep them short. This is also called from update.php.

Код

<?php
function _drupal_flush_css_js() {
  $string_history = variable_get('css_js_query_string', '00000000000000000000');
  $new_character = $string_history[0];
  // Not including 'q' to allow certain JavaScripts to re-use query string.
  $characters = 'abcdefghijklmnoprstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
  while (strpos($string_history, $new_character) !== FALSE) {
    $new_character = $characters[mt_rand(0, strlen($characters) - 1)];
  }
  variable_set('css_js_query_string', $new_character . substr($string_history, 0, 19));
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему