You are here

function sparkpost_requirements in Sparkpost email 7.2

Same name and namespace in other branches
  1. 7 sparkpost.install \sparkpost_requirements()

Implements hook_requirements().

File

./sparkpost.install, line 11
Install, update and uninstall functions for the sparkpost module.

Code

function sparkpost_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break at install time.
  $t = get_t();
  if ($phase == 'runtime') {
    $requirements['sparkpost'] = array(
      'title' => $t('Sparkpost'),
      'value' => class_exists('\\SparkPost\\SparkPost') ? $t('Yes') : $t('No'),
      'description' => $t('Sparkpost composer package'),
      'severity' => class_exists('\\SparkPost\\SparkPost') ? REQUIREMENT_OK : REQUIREMENT_ERROR,
    );
  }
  return $requirements;
}