Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'letapjar-hook_requirements'

  • Loading branch information...
commit 911f827183ab0c2d3ff6f712878d00ac9579adb2 2 parents e7900fe + 3d3e52e
@KyleAMathews KyleAMathews authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 og_mailinglist.install
View
15 og_mailinglist.install
@@ -1,5 +1,6 @@
<?php
// $Id$
+include_once 'og_mailinglist_utilities.inc'; //Load our utilities so the hook_requirements can call those functions.
/**
* Implementation of hook_install().
*/
@@ -48,6 +49,20 @@ function og_mailinglist_requirements($phase) {
$requirements['og_mailinglist_phpmailer']['description'] = t('The <a href="@phpmailer">PHPMailer</a> library is missing or not installed correctly. <a href="@download">Download</a> and extract it to your <em>og_mailinglist</em> module directory. See the INSTALL.txt file for more information at path/to/drupal@install.', array('@phpmailer' => 'http://phpmailer.worxware.com/index.php?pg=phpmailer', '@download' => 'http://sourceforge.net/projects/phpmailer/files/phpmailer%20for%20php5_6/', '@install' => url(drupal_get_path('module', 'og_mailinglist') . '/INSTALL.txt')));
$requirements['og_mailinglist_phpmailer']['severity'] = REQUIREMENT_ERROR;
}
+
+ //Check for the Mail_mimeDecode library.
+ og_mailinglist_mimeDecode_load_library();
+ $requirements['og_mailinglist_mimeDecode']['title'] = t('Mail_mimeDecode PEAR extension');
+ if (class_exists('Mail_mimeDecode')) {
+ $requirements['og_mailinglist_mimeDecode']['value'] = 'Mail_mimeDecode PEAR Extension found';
+ $requirements['og_mailinglist_mimeDecode']['severity'] = REQUIREMENT_OK;
+ }
+ else {
+ // Required library wasn't found.
+ $requirements['og_mailinglist_mimeDecode']['value'] = t('Not found');
+ $requirements['og_mailinglist_mimeDecode']['description'] = t('The Mail_mimeDecode PEAR extension is missing or not installed correctly. Check that the extension is installed and that your PHP include_path is correct. See the INSTALL.txt file for more information at path/to/drupal@install.', array('@install' => url(drupal_get_path('module', 'og_mailinglist') . '/INSTALL.txt')));
+ $requirements['og_mailinglist_mimeDecode']['severity'] = REQUIREMENT_ERROR;
+ }
}
return $requirements;
Please sign in to comment.
Something went wrong with that request. Please try again.