You are here

function _views_fetch_plugin_data in Views (for Drupal 7) 6.3

Same name and namespace in other branches
  1. 6.2 includes/cache.inc \_views_fetch_plugin_data()
  2. 7.3 includes/cache.inc \_views_fetch_plugin_data()

Fetch the plugin data from cache.

1 call to _views_fetch_plugin_data()
views_fetch_plugin_data in ./views.module
Fetch the plugin data from cache.

File

includes/cache.inc, line 65
cache.inc

Code

function _views_fetch_plugin_data($type = NULL, $plugin = NULL, $reset = FALSE) {
  static $cache = NULL;
  if (!isset($cache) || $reset) {
    $start = views_microtime();
    views_include_handlers();
    $cache = views_discover_plugins();
    vpr('Views plugins build time: ' . (views_microtime() - $start) * 1000 . ' ms');
  }
  if (!$type && !$plugin) {
    return $cache;
  }
  else {
    if (!$plugin) {

      // Not in the if above so the else below won't run
      if (isset($cache[$type])) {
        return $cache[$type];
      }
    }
    else {
      if (isset($cache[$type][$plugin])) {
        return $cache[$type][$plugin];
      }
    }
  }

  // Return an empty array if there is no match.
  return array();
}