You are here

function uc_usps_requirements in Ubercart 6.2

Implements hook_requirements().

File

shipping/uc_usps/uc_usps.install, line 11
Install hooks for uc_usps.module.

Code

function uc_usps_requirements($phase) {
  $t = get_t();
  $has_simplexml = extension_loaded('SimpleXML');
  $requirements['uc_usps_simplexml'] = array(
    'title' => $t('SimpleXML'),
    'value' => $has_simplexml ? $t('Enabled') : $t('Not found'),
  );
  if (!$has_simplexml) {
    $requirements['uc_usps_simplexml']['severity'] = REQUIREMENT_ERROR;
    $requirements['uc_usps_simplexml']['description'] = $t('USPS requires the PHP <a href="!simplexml_url">SimpleXML</a> library.', array(
      '!simplexml_url' => 'http://www.php.net/simplexml',
    ));
  }
  return $requirements;
}