[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/simple_paypal/ -> simple_paypal.install (source)

   1  <?php
   2  
   3  /**
   4   * Check that the cURL extension exists for PHP.
   5   */
   6  function simple_paypal_requirements($phase) {
   7    $requirements = array();
   8    $t = get_t();
   9    
  10    $has_curl = function_exists('curl_init');
  11    
  12    switch ($phase) {
  13      case 'runtime':
  14        $requirements['simple_paypal'] = array(
  15          'title'    => $t('cURL'),
  16          'value'    => $has_curl ? $t('Enabled') : $t('Not found'),
  17          'severity' => $has_curl ? REQUIREMENT_OK : REQUIREMENT_ERROR,
  18        );
  19        break;
  20      case 'install':
  21        if ($has_curl) {
  22          $requirements['simple_paypal'] = array(
  23            'title'    => $t('cURL'),
  24            'severity' => REQUIREMENT_OK,
  25          );
  26        }
  27        else {
  28          $requirements['simple_paypal'] = array(
  29            'title'       => $t('cURL'),
  30            'severity'    => REQUIREMENT_ERROR,
  31            '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')),
  32          );
  33        }
  34        break;
  35    }
  36    
  37    return $requirements;
  38  }


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7