You are here

public function AuthcacheP13nDefaultRequestUrlGenerator::__construct in Authenticated User Page Caching (Authcache) 7.2

Construct new request URL generator.

Parameters

String $front_controller: Path to the personalization fragment frontcontroller relative to DRUPAL_ROOT.

int $cache_granularity: Cache granularity.

File

modules/authcache_p13n/includes/AuthcacheP13nDefaultRequestUrlGenerator.inc, line 31
Defines request URL generator.

Class

AuthcacheP13nDefaultRequestUrlGenerator
Interface for request url generators.

Code

public function __construct($front_controller, AuthcacheP13nCacheGranularity $cache_granularity) {

  // If the frontcontroller is given as a relative path, prepend it with the
  // base path.
  $parts = parse_url($front_controller);
  if (empty($parts['host'])) {
    $this->frontControllerURL = base_path() . $front_controller;
  }
  else {
    $this->frontControllerURL = $front_controller;
  }
  $this->cacheGranularity = $cache_granularity;
}