From e1d3687b23efd8087a441e3a63171fe7c1a7bea6 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 29 Aug 2009 21:07:43 +0000 Subject: - Patch #504630 by Dave Van Den Bremt: aded requirements check. --- modules/openid/openid.install | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'modules/openid') diff --git a/modules/openid/openid.install b/modules/openid/openid.install index 054b3b017..6dd056bcd 100644 --- a/modules/openid/openid.install +++ b/modules/openid/openid.install @@ -73,3 +73,30 @@ function openid_schema() { return $schema; } + +/** + * Implement hook_requirements(). + */ +function openid_requirements($phase) { + $requirements = array(); + + if ($phase == 'runtime') { + // Check for the PHP BC Math library. + if (!function_exists('bcadd')) { + $requirements['bcmath'] = array( + 'value' => t('Not installed'), + 'severity' => REQUIREMENT_ERROR, + 'description' => t('OpenID requires the BC Math library for PHP which is missing or outdated. Please check the PHP BC Math Library documentation for information on how to correct this.', array('@url' => 'http://www.php.net/manual/en/book.bc.php')), + ); + } + else { + $requirements['bcmath'] = array( + 'value' => t('Installed'), + 'severity' => REQUIREMENT_OK, + ); + } + $requirements['bcmath']['title'] = t('BC Match library'); + } + + return $requirements; +} -- cgit v1.2.3