You are here

function boost_match_header_attributes in Boost 7

Given header info, match it to a file extension

Parameters

$header_info: array contains header info

Return value

array

4 calls to boost_match_header_attributes()
boost_block_flush_form_submit in ./boost.blocks.inc
boost_block_view_status in ./boost.blocks.inc
@file Prints the cache status of the currently displayed page.
boost_exit in ./boost.module
Implements hook_exit().
boost_expire_cache in ./boost.module
Implements hook_expire_cache (from the 'expire' module)

File

./boost.module, line 1084
Caches generated output as a static file to be served directly from the webserver.

Code

function boost_match_header_attributes($header_info) {
  $type = $header_info['content-type-basic'];
  $enabled = variable_get('boost_enabled_' . $type, -1);
  if ($enabled === -1) {
    boost_get_storage_types();
    $enabled = variable_get('boost_enabled_' . $type, -1);
    if ($enabled === -1) {
      variable_set('boost_enabled_' . $type, FALSE);
      $enabled = FALSE;
    }
  }
  if (!$enabled) {
    return array(
      'enabled' => FALSE,
    );
  }
  $keys = array(
    'enabled',
    'gzip',
    'extension',
    'lifetime_max',
    'lifetime_min',
    'comment_start',
    'comment_end',
  );
  $info = array();
  foreach ($keys as $key) {
    $info[$key] = variable_get('boost_' . $key . '_' . $type, -1);
    if ($info[$key] === -1) {
      return array(
        'enabled' => FALSE,
      );
    }
  }
  return $info;
}