You are here

function _esi_get_drupal_distribution in ESI: Edge Side Includes 6.2

Checks what Drupal distribution is in use. Drupal, Pressflow, or Cocomore.

Taken from cdn.requirements.inc.

See also

_cdn_requirements_is_patched_distribution().

1 call to _esi_get_drupal_distribution()
esi_set_page_cache in ./esi.module

File

./esi.inc, line 198
Helper functions for the ESI module.

Code

function _esi_get_drupal_distribution() {
  static $distribution;
  if (!empty($distribution)) {
    return $distribution;
  }
  $profile = realpath('.') . '/profiles/default/default.profile';
  if (!file_exists($profile)) {
    $distribution = 'drupal';
    return $distribution;
  }
  include_once $profile;
  $default = default_profile_details();
  if ($default['name'] == 'Pressflow') {
    $distribution = 'pressflow';
  }
  elseif (stristr($default['name'], 'cocomore')) {
    $distribution = 'cocomore';
  }
  else {
    $distribution = 'drupal';
  }
  return $distribution;
}