You are here

function acquia_spi_get_system_status in Acquia Connector 6.2

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

This function is a trimmed version of Drupal's system_status function

Return value

array

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

File

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

Code

function acquia_spi_get_system_status() {
  $data = array();
  $data['php'] = array(
    'title' => 'PHP',
    'value' => phpversion(),
  );
  $conf_dir = TRUE;
  $settings = TRUE;
  $dir = conf_path();
  if (is_writable($dir) || is_writable($dir . '/settings.php')) {
    $value = 'Not protected';
    if (is_writable($dir)) {
      $conf_dir = FALSE;
    }
    elseif (is_writable($dir . '/settings.php')) {
      $settings = FALSE;
    }
  }
  else {
    $value = 'Protected';
  }
  $data['settings.php'] = array(
    'title' => 'Configuration file',
    'value' => $value,
    'conf_dir' => $conf_dir,
    'settings' => $settings,
  );
  $cron_last = variable_get('cron_last', NULL);
  if (!is_numeric($cron_last)) {
    $cron_last = variable_get('install_time', 0);
  }
  $data['cron'] = array(
    'title' => 'Cron maintenance tasks',
    'value' => t('Last run !time ago', array(
      '!time' => format_interval(time() - $cron_last),
    )),
    'cron_last' => $cron_last,
  );
  if (!empty($GLOBALS['update_free_access'])) {
    $data['update access'] = array(
      'value' => 'Not protected',
      'protected' => FALSE,
    );
  }
  else {
    $data['update access'] = array(
      'value' => 'Protected',
      'protected' => TRUE,
    );
  }
  $data['update access']['title'] = 'Access to update.php';
  if (!module_exists('update')) {
    $data['update status'] = array(
      'value' => 'Not enabled',
    );
  }
  else {
    $data['update status'] = array(
      'value' => 'Enabled',
    );
  }
  $data['update status']['title'] = 'Update notifications';
  return $data;
}