Projet

Général

Profil

Révision 6f57d8c7

Ajouté par Assos Assos il y a environ 9 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/views/includes/cache.inc
67 67
  }
68 68
  else {
69 69
    if (!$fully_loaded) {
70
      $data = views_cache_get('views_data', TRUE);
71
      if (!empty($data->data)) {
70
      if ($data = views_cache_get('views_data', TRUE)) {
72 71
        $cache = $data->data;
73 72
      }
74

  
75
      if (empty($cache)) {
73
      else {
74
        // No cache entry, rebuild.
76 75
        $cache = _views_fetch_data_build();
77 76
      }
78 77
      $fully_loaded = TRUE;
......
127 126
function _views_fetch_plugin_data($type = NULL, $plugin = NULL, $reset = FALSE) {
128 127
  static $cache = NULL;
129 128
  if (!isset($cache) || $reset) {
130
    $start = microtime(TRUE);
131
    views_include('plugins');
132
    views_include_handlers();
133

  
134
    $cache = views_discover_plugins();
135

  
129
    // Load necessary code once.
130
    if (!isset($cache)) {
131
      views_include('plugins');
132
      views_include_handlers();
133
    }
134
    // Because plugin data contains translated strings, and as such can be
135
    // expensive to build, the results are cached per language.
136
    global $language;
137
    $cache_key = 'views:plugin_data:' . $language->language;
138
    if (!$reset) {
139
      if ($cache = cache_get($cache_key)) {
140
        $cache = $cache->data;
141
      }
142
    }
143
    // If not available in the cache, build it and cache it.
144
    if (!$cache) {
145
      $cache = views_discover_plugins();
146
      cache_set($cache_key, $cache);
147
    }
136 148
  }
137 149

  
138 150
  if (!$type && !$plugin) {

Formats disponibles : Unified diff