You are here

function _acquia_purge_diagnostics_acquia_environment in Acquia Purge 7

Acquia environment.

Parameters

string $t: Name of the t() function to call.

AcquiaPurgeService $service: The Acquia Purge service.

Return value

array Associative array with the following elements:

1 string reference to '_acquia_purge_diagnostics_acquia_environment'
acquia_purge_acquia_purge_diagnostics in ./acquia_purge.module
Implements hook_acquia_purge_diagnostics().

File

./acquia_purge.diagnostics.inc, line 175
Diagnostic self-tests and reports that aim to prevent runtime misery.

Code

function _acquia_purge_diagnostics_acquia_environment($t, $service) {
  $test = array(
    'title' => $t('Acquia environment'),
  );
  if ($service
    ->hostingInfo()
    ->isThisAcquiaCloud()) {
    $test['value'] = $t('Acquia Cloud (@name.@env)', array(
      '@name' => $service
        ->hostingInfo()
        ->getSiteName(),
      '@env' => $service
        ->hostingInfo()
        ->getSiteEnvironment(),
    ));
    $test['severity'] = ACQUIA_PURGE_SEVLEVEL_INFO;
  }
  else {
    $test['value'] = $t('Third-party');
    $test['description'] = $t('Acquia Purge only works on Acquia Cloud and has' . ' disabled itself as this environment appears different. Any items in' . ' the queue will get processed as soon as you deployed your site.');
    $test['severity'] = ACQUIA_PURGE_SEVLEVEL_ERROR;
  }
  return $test;
}