You are here

function cdn_cdn_unique_file_identifier_info in CDN 6.2

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

Implementation of hook_cdn_unique_file_identifier_info().

File

./cdn.module, line 161

Code

function cdn_cdn_unique_file_identifier_info() {

  // Keys are machine names.
  return array(
    'md5_hash' => array(
      'label' => t('MD5 hash'),
      'prefix' => 'md5',
      'description' => t('MD5 hash of the file.'),
      'filesystem' => TRUE,
      'callback' => 'md5_file',
    ),
    'mtime' => array(
      'label' => t('Last modification time'),
      'prefix' => 'mtime',
      'description' => t('Last modification time of the file.'),
      'filesystem' => TRUE,
      'callback' => 'filemtime',
    ),
    'perpetual' => array(
      'label' => t('Perpetual'),
      'prefix' => 'perpetual',
      'description' => t('Perpetual files never change (or are never cached
                          by the browser, e.g. video files).'),
      'filesystem' => FALSE,
      'value' => 'forever',
    ),
    'drupal_version' => array(
      'label' => t('Drupal version'),
      'prefix' => 'drupal',
      'description' => t('Drupal core version — this should only be applied
                          to files that ship with Drupal core.'),
      'filesystem' => FALSE,
      'value' => VERSION,
    ),
    'drupal_cache' => array(
      'label' => t('Drupal cache'),
      'prefix' => 'drupal-cache',
      'description' => t('Uses the current Drupal cache ID
                          (<code>css_js_query_string</code>). This ID is
                          updated automatically whenever the Drupal cache is
                          flushed (e.g. when you submit the modules form). Be
                          aware that this can change relatively often, forcing
                          redownloads by your visitors.'),
      'filesystem' => FALSE,
      'value' => variable_get('css_js_query_string', 0),
    ),
    'deployment_id' => array(
      'label' => t('Deployment ID'),
      'prefix' => 'deployment',
      'description' => t('A developer-defined deployment ID. Can be an
                          arbitrary string or number, as long as it uniquely
                          identifies deployments and therefore the affected
                          files.<br />
                          Define this deployment ID in any enabled module or
                          in <code>settings.php</code> as the
                          <code>CDN_DEPLOYMENT_ID</code>
                          constant, and it will be picked up instantaneously.'),
      'filesystem' => FALSE,
      'callback' => '_cdn_ufi_deployment_id',
    ),
  );
}