You are here

function warden_get_api in Warden 7

Same name and namespace in other branches
  1. 6 warden.module \warden_get_api()

Return value

WardenAPI

Throws

Exception

File

./warden.module, line 103
Drupal system status

Code

function warden_get_api() {
  $warden_encryption =& drupal_static(__FUNCTION__);
  if (empty($warden_encryption)) {
    $url = variable_get('warden_server_host_path', FALSE);
    if (empty($url)) {
      throw new Exception('Warden URL not configured');
    }
    $username = variable_get('warden_http_username', '');
    $password = variable_get('warden_http_password', '');
    $warden_encryption = new WardenAPI($url, $username, $password);
  }
  return $warden_encryption;
}