You are here

function oauth_requirements in OAuth 1.0 8

Same name and namespace in other branches
  1. 8.2 oauth.install \oauth_requirements()

Implements hook_requirements().

File

./oauth.install, line 10
Installation and schema related functions for the OAuth module.

Code

function oauth_requirements($phase) {
  $requirements = array();
  $oauth_available = class_exists('\\OauthProvider');
  $requirements['oauth_pecl'] = array(
    'title' => t('OAuth'),
    'value' => $oauth_available ? t('OAuth PECL library installed') : t('OAuth PECL library not installed'),
  );
  if (!$oauth_available) {
    $requirements['oauth_pecl'] += array(
      'severity' => REQUIREMENT_ERROR,
      'description' => t("OAuth module requires the <a href='@oauth_url' target='_blank'>PECL OAuth</a> library.", array(
        '@oauth_url' => 'http://www.php.net/manual/en/book.oauth.php',
      )),
    );
  }
  return $requirements;
}