1.20.x views_plugin_cache.inc views_plugin_cache::get_output_key()

File

modules/views/plugins/views_plugin_cache.inc, line 327
Definition of views_plugin_cache.

Class

views_plugin_cache
The base plugin to handle caching.

Code

function get_output_key() {
  global $user;
  if (!isset($this->_output_key)) {
    $key_data = array(
      'result' => $this->view->result,
      'roles' => array_keys($user->roles),
      'super-user' => $user->uid == 1, // special caching for super user.
      'theme' => $GLOBALS['theme'],
      'language' => $GLOBALS['language']->langcode,
      'base_url' => $GLOBALS['base_url'],
    );

    $this->_output_key = $this->view->name . ':' . $this->display->id . ':output:' . md5(serialize($key_data));
  }

  return $this->_output_key;
}