Browse Source

Use do_curl instead of drupal_http_request for availability check.

pull/105/head
Alexander O'Neill 14 years ago
parent
commit
d159169516
  1. 4
      ConnectionHelper.inc
  2. 4
      api/fedora_utils.inc

4
ConnectionHelper.inc

@ -21,10 +21,10 @@ class ConnectionHelper {
$creds = urlencode($_name) . ':'. urlencode($_pass);
if (strpos($url, 'http://') == 0) {
if (strpos($url, 'http://') === 0) {
$new_url = 'http://'. $creds . '@'. substr($url, 7);
}
elseif (strpos($url, 'https://') == 0) {
elseif (strpos($url, 'https://') === 0) {
$new_url = 'https://'. $creds . '@'. substr($url, 8);
}
else {

4
api/fedora_utils.inc

@ -66,8 +66,8 @@ function do_curl($url, $return_to_variable = 1, $number_of_post_vars = 0, $post
}
function fedora_available() {
$response = drupal_http_request(variable_get('fedora_base_url', 'http://localhost:8080/fedora').'/describe');
return ($response->code == 200);
$response = do_curl(variable_get('fedora_base_url', 'http://localhost:8080/fedora').'/describe');
return strstr($response, 'Repository Information HTML Presentation') !== FALSE;
}
/**

Loading…
Cancel
Save