You are here

function cdn_cacheaudit in CDN 6.2

Same name and namespace in other branches
  1. 7.2 cdn.module \cdn_cacheaudit()

Implements hook_cacheaudit().

File

./cdn.module, line 524

Code

function cdn_cacheaudit() {
  $results = array(
    array(
      'Settings',
      'Value',
    ),
  );
  $status = variable_get(CDN_STATUS_VARIABLE, CDN_DISABLED);
  if ($status == CDN_ENABLED) {
    $status_value = 'enabled';
  }
  elseif ($status == CDN_TESTING) {
    $status_value = 'testing';
  }
  else {
    $status_value = 'disabled';
  }
  $results[] = array(
    'Status',
    $status_value,
  );
  $mode = variable_get(CDN_MODE_VARIABLE, CDN_MODE_BASIC);
  $results[] = array(
    'Mode',
    $mode ? 'Origin Pull' : 'File Conveyor',
  );
  if ($mode == CDN_MODE_BASIC) {
    cdn_load_include('basic');
    $results[] = array(
      '    mappings',
      count(_cdn_basic_parse_raw_mapping(cdn_basic_get_mapping())),
    );
    $results[] = array(
      '    Far Future expiration',
      variable_get(CDN_BASIC_FARFUTURE_VARIABLE, CDN_BASIC_FARFUTURE_DEFAULT),
    );
  }
  $results[] = array(
    'Domains',
    count(cdn_get_domains()),
  );
  return array(
    'cdn' => $results,
  );
}