You are here

function mailhandler_requirements in Mailhandler 7

Same name and namespace in other branches
  1. 5 mailhandler.install \mailhandler_requirements()
  2. 6.2 mailhandler.install \mailhandler_requirements()
  3. 6 mailhandler.install \mailhandler_requirements()
  4. 7.2 mailhandler.install \mailhandler_requirements()

Check that the IMAP extension exists for PHP.

File

./mailhandler.install, line 167

Code

function mailhandler_requirements($phase) {

  // Ensure translations don't break at install time
  $t = get_t();
  $has_imap = function_exists('imap_open');
  $requirements['mailhandler'] = array(
    'title' => $t('IMAP'),
    'description' => $t("Mailhandler 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;
}