You are here

function mailhandler_requirements in Mailhandler 6

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

Check that the IMAP extension exists for PHP.

@todo: currently the module is unable to work without IMAP extension, but for convenience, I'm still allowing the module to be enabled so parts of the main functionality can be automatically tested by PIFR. This must be changed when the IMAP extension is no longer a dependency for this module to work.

File

./mailhandler.install, line 210
Install, uninstall, schema and update functions for Mailhandler module.

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;
}