You are here

function swiftmailer_requirements in Swift Mailer 8.2

Same name and namespace in other branches
  1. 8 swiftmailer.install \swiftmailer_requirements()

Implements hook_requirements().

File

./swiftmailer.install, line 11
Contains install and update functions for SwiftMailer.

Code

function swiftmailer_requirements($phase) {
  $requirements = [];
  if ($phase == 'install') {
    if (!class_exists('Swift_Mailer')) {
      $requirements['swiftmailer_library'] = [
        'description' => t('Swift Mailer requires the external Swift Mailer library. The recommended way of solving this dependency is using the <a href=":url">Composer Manager</a> module.', [
          ':url' => 'https://www.drupal.org/project/composer_manager',
        ]),
        'severity' => REQUIREMENT_ERROR,
      ];
    }
  }
  return $requirements;
}