You are here

AuthcacheP13nCacheGranularity.inc in Authenticated User Page Caching (Authcache) 7.2

Defines the cache granularity class.

File

modules/authcache_p13n/includes/AuthcacheP13nCacheGranularity.inc
View source
<?php

/**
 * @file
 * Defines the cache granularity class.
 */

/**
 * Cache granularity class.
 *
 * @see AuthcacheP13nAddCacheControlHeaderFilter
 * @see AuthcacheP13nDefaultRequestUrlGenerator
 */
class AuthcacheP13nCacheGranularity {
  const PER_USER = 0x2;
  const PER_PAGE = 0x4;
  protected $granularity;

  /**
   * Construct new cache granularity instance.
   */
  public function __construct($granularity) {
    $this->granularity = $granularity;
  }

  /**
   * Test whether a given granularity is set.
   */
  public function is($flag) {
    return $this->granularity & $flag;
  }

}

Classes

Namesort descending Description
AuthcacheP13nCacheGranularity Cache granularity class.