You are here

function mailhandler_php_imap_requirements in Mailhandler 6.2

Same name and namespace in other branches
  1. 7.2 modules/mailhandler_php_imap/mailhandler_php_imap.install \mailhandler_php_imap_requirements()

Implementation of hook_requirements().

Check that the IMAP extension exists for PHP.

File

modules/mailhandler_php_imap/mailhandler_php_imap.install, line 12
Install, update and uninstall functions for the Mailhandler module.

Code

function mailhandler_php_imap_requirements($phase) {

  // Ensure translations don't break at install time
  $t = get_t();
  $has_imap = function_exists('imap_open');
  $requirements['mailhandler_php_imap'] = array(
    'title' => $t('Mailhandler PHP IMAP'),
    'description' => $t("Mailhandler PHP IMAP requires that PHP's !ext is enabled in order to function properly.", array(
      '!ext' => l('IMAP extension', 'http://www.php.net/imap'),
    )),
    'value' => $has_imap ? $t('Enabled') : $t('Not found'),
    'severity' => $has_imap ? REQUIREMENT_OK : REQUIREMENT_ERROR,
  );
  return $requirements;
}