You are here

function acquia_spi_get_version_info in Acquia Connector 7.2

Same name and namespace in other branches
  1. 6.2 acquia_spi/acquia_spi.module \acquia_spi_get_version_info()
  2. 7.3 acquia_spi/acquia_spi.module \acquia_spi_get_version_info()

Attempt to determine the version of Drupal being used. Note, there is better information on this in the common.inc file.

Return value

array An array containing some detail about the version

1 call to acquia_spi_get_version_info()
acquia_spi_get in acquia_spi/acquia_spi.module
Gather site profile information about this site.

File

acquia_spi/acquia_spi.module, line 924
Send site profile information (NSPI) and system data to Acquia Insight.

Code

function acquia_spi_get_version_info() {
  $store = acquia_spi_data_store_get(array(
    'platform',
  ));
  $server = !empty($store) && isset($store['platform']) ? $store['platform']['php_quantum']['SERVER'] : $_SERVER;
  $ver = array();
  $ver['base_version'] = VERSION;
  $install_root = $server['DOCUMENT_ROOT'] . base_path();
  $ver['distribution'] = '';

  // Determine if this puppy is Acquia Drupal
  acquia_agent_load_versions();
  if (IS_ACQUIA_DRUPAL) {
    $ver['distribution'] = 'Acquia Drupal';
    $ver['ad']['version'] = ACQUIA_DRUPAL_VERSION;
    $ver['ad']['series'] = ACQUIA_DRUPAL_SERIES;
    $ver['ad']['branch'] = ACQUIA_DRUPAL_BRANCH;
    $ver['ad']['revision'] = ACQUIA_DRUPAL_REVISION;
  }

  // Determine if we are looking at Pressflow
  if (defined('CACHE_EXTERNAL')) {
    $ver['distribution'] = 'Pressflow';
    $press_version_file = $install_root . './PRESSFLOW.txt';
    if (is_file($press_version_file)) {
      $ver['pr']['version'] = trim(file_get_contents($press_version_file));
    }
  }
  elseif (is_dir($install_root . '/profiles/openatrium')) {
    $ver['distribution'] = 'Open Atrium';
    $version_file = $install_root . 'profiles/openatrium/VERSION.txt';
    if (is_file($version_file)) {
      $ver['oa']['version'] = trim(file_get_contents($version_file));
    }
  }
  elseif (is_dir($install_root . '/profiles/commons')) {
    $ver['distribution'] = 'Commons';
  }
  elseif (is_dir($install_root . '/profiles/cod')) {
    $ver['distribution'] = 'COD';
  }
  return $ver;
}