You are here

function warden_get_api in Warden 6

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

Return value

WardenAPI

Throws

Exception

File

./warden.module, line 104
Drupal system status

Code

function warden_get_api() {
  static $warden_encryption = NULL;
  module_load_include('inc', 'warden', 'warden_api');
  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;
}