You are here

function commerce_fedex_requirements in Commerce FedEx 7

Implements hook_requirements()

File

./commerce_fedex.install, line 71
Handles installation for Commerce FedEx module.

Code

function commerce_fedex_requirements($phase) {
  $requirements = array();
  if ($phase == 'runtime') {
    if (class_exists('SoapClient')) {
      $requirements['commerce_fedex'] = array(
        'title' => t('Soap extension'),
        'value' => t('Enabled'),
        'severity' => REQUIREMENT_OK,
      );
    }
    else {
      $requirements['commerce_fedex'] = array(
        'title' => t('Soap extension'),
        'value' => t('Not enabled'),
        'severity' => REQUIREMENT_ERROR,
        'description' => t('The SOAP library for PHP is missing. Check the <a href="@url">PHP SOAP documentation</a> for information on how to correct this.', array(
          '@url' => 'http://www.php.net/manual/en/book.soap.php',
        )),
      );
    }
  }
  return $requirements;
}