/[drupal]/contributions/modules/simple_paypal/simple_paypal.install
ViewVC logotype

Contents of /contributions/modules/simple_paypal/simple_paypal.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Thu Sep 24 17:11:38 2009 UTC (2 months ago) by kbahey
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-7--1
Changes since 1.1: +12 -3 lines
File MIME type: text/x-php
#586908 by jbrown, update to Drupal 7.x. Awesome
1 <?php
2 // $Id: simple_paypal.install,v 1.1 2008/10/01 21:59:37 kbahey Exp $
3
4
5 /**
6 * @file
7 * Install, update and uninstall functions for the simple_paypal module.
8 */
9
10
11 /**
12 * Implement hook_requirements().
13 *
14 * Check that the cURL extension exists for PHP.
15 */
16 function simple_paypal_requirements($phase) {
17 $requirements = array();
18 $t = get_t();
19
20 $has_curl = function_exists('curl_init');
21
22 switch ($phase) {
23 case 'runtime':
24 $requirements['simple_paypal'] = array(
25 'title' => $t('cURL'),
26 'value' => $has_curl ? $t('Enabled') : $t('Not found'),
27 'severity' => $has_curl ? REQUIREMENT_OK : REQUIREMENT_ERROR,
28 );
29 break;
30 case 'install':
31 if ($has_curl) {
32 $requirements['simple_paypal'] = array(
33 'title' => $t('cURL'),
34 'severity' => REQUIREMENT_OK,
35 );
36 }
37 else {
38 $requirements['simple_paypal'] = array(
39 'title' => $t('cURL'),
40 'severity' => REQUIREMENT_ERROR,
41 'description' => $t('Simple Paypal could not be installed because the PHP <a href="!curl_url">cURL</a> library is not available.', array('!curl_url' => 'http://php.net/manual/en/curl.setup.php')),
42 );
43 }
44 break;
45 }
46
47 return $requirements;
48 }

  ViewVC Help
Powered by ViewVC 1.1.2