You are here

function replication_get_http_response_code in Replication 8.2

Same name and namespace in other branches
  1. 8 replication.drush.inc \replication_get_http_response_code()

Returns the response code for a request.

Parameters

$url:

Return value

string

1 call to replication_get_http_response_code()
replication_command_validate in ./replication.drush.inc
Helper function for command validation.

File

./replication.drush.inc, line 246
Drush integration for the replication module.

Code

function replication_get_http_response_code($url) {
  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_exec($ch);
  $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  curl_close($ch);
  return $httpcode;
}