You are here

function authcache_p13n_authcache_p13n_base_request in Authenticated User Page Caching (Authcache) 7.2

Implements hook_authcache_p13n_base_request().

Related topics

File

modules/authcache_p13n/authcache_p13n.module, line 989
Provides methods for serving personalized content fragments.

Code

function authcache_p13n_authcache_p13n_base_request() {
  $frontcontroller_path = variable_get('authcache_p13n_frontcontroller_path', drupal_get_path('module', 'authcache_p13n') . '/frontcontroller/authcache.php');

  // Note that fragment, setting, assembly request need to provide 'content
  // builder' and 'content encoder' resources.
  return array(
    // Overridable resources.
    'cache maxage' => 600,
    'cache granularity' => AuthcacheP13nCacheGranularity::PER_USER,
    'bootstrap phase' => NULL,
    'admin type' => t('Unknown'),
    'admin group' => t('Other'),
    'admin name' => t('Unknown'),
    'admin description' => '',
    'admin path' => NULL,
    'admin entry object' => '@admin entry[as_object]',
    'conf override' => array(),
    // Normally not overridden.
    'cache granularity object' => array(
      '#class' => 'AuthcacheP13nCacheGranularity',
      '#arguments' => array(
        '@cache granularity',
      ),
    ),
    'cache control header' => array(
      '#class' => 'AuthcacheP13nAddCacheControlHeaderFilter',
      '#arguments' => array(
        '@services[require_instance(AuthcacheP13nCoreServiceInterface)]',
        '@cache maxage',
        '@cache granularity object[require_instance(AuthcacheP13nCacheGranularity)]',
      ),
      '#member_of' => 'request filters',
    ),
    'request validator' => '@content builder[accept_instance(AuthcacheP13nRequestValidatorInterface)]',
    'request filters' => array(
      '#collection' => 'request filters',
      '#processor' => 'require_instance(AuthcacheP13nFilterInterface)',
    ),
    'response filters' => array(
      '#collection' => 'response filters',
      '#processor' => 'require_instance(AuthcacheP13nFilterInterface)',
    ),
    'filters' => array(
      'request' => '@request filters',
      'response' => '@response filters',
    ),
    'conf override context provider' => array(
      '#class' => 'AuthcacheP13nConfOverrideContextProvider',
      '#arguments' => array(
        '@conf override',
      ),
      '#weight' => -150,
      '#member_of' => 'context providers',
      '#key' => 'conf override',
    ),
    'bootstrap context provider' => array(
      '#class' => 'AuthcacheP13nBootstrapContextProvider',
      '#arguments' => array(
        '@services[require_instance(AuthcacheP13nCoreServiceInterface)]',
        '@bootstrap phase',
      ),
      '#weight' => -50,
      '#member_of' => 'context providers',
      '#key' => 'bootstrap phase',
    ),
    'context providers' => array(
      '#collection' => 'context providers',
      '#processor' => 'require_instance(AuthcacheP13nContextProviderInterface)',
    ),
    'handler' => array(
      '#class' => 'AuthcacheP13nDefaultRequestHandler',
      '#arguments' => array(
        '@services[require_instance(AuthcacheP13nCoreServiceInterface)]',
        '@request validator[accept_instance(AuthcacheP13nRequestValidatorInterface)]',
        '@content builder[require_instance(AuthcacheP13nContentBuilderInterface)]',
        '@content encoder[require_instance(AuthcacheP13nContentEncoderInterface)]',
        '@filters',
        '@context providers',
      ),
    ),
    'frontcontroller' => array(
      '#value' => $frontcontroller_path,
    ),
    'url generator' => array(
      '#class' => 'AuthcacheP13nDefaultRequestUrlGenerator',
      '#arguments' => array(
        '@frontcontroller',
        '@cache granularity object[require_instance(AuthcacheP13nCacheGranularity)]',
      ),
    ),
    'services' => array(
      '#class' => 'AuthcacheP13nDefaultCoreService',
    ),
    'admin entry' => array(
      'type' => '@admin type',
      'group' => '@admin group',
      'name' => '@admin name',
      'description' => '@admin description',
      'clients' => NULL,
      'cacheMaxage' => '@cache maxage',
      'cacheGranularity' => '@cache granularity object[require_instance(AuthcacheP13nCacheGranularity)]',
      'adminPath' => '@admin path',
    ),
  );
}