You are here

function _acquia_agent_request in Acquia Connector 6

Same name and namespace in other branches
  1. 6.2 acquia_agent/acquia_agent_streams.inc \_acquia_agent_request()
  2. 7.3 acquia_agent/acquia_agent.module \_acquia_agent_request()
  3. 7 acquia_agent/acquia_agent.module \_acquia_agent_request()
  4. 7.2 acquia_agent/acquia_agent.module \_acquia_agent_request()

Send a XML-RPC request.

This function should never be called directly - use acquia_agent_call().

1 call to _acquia_agent_request()
acquia_agent_call in acquia_agent/acquia_agent.module
Prepare and send a XML-RPC request to Acquia Network with an authenticator.

File

acquia_agent/acquia_agent_streams.inc, line 293
XML-RPC communication functions for Acquia communication.

Code

function _acquia_agent_request($url, $method, $data) {
  $ctx = acquia_agent_stream_context_create($url);
  if (!$ctx) {

    // TODO: what's a meaningful fault code?
    xmlrpc_error(-1, t('SSL is not supported or setup failed'));
    $result = FALSE;
  }
  else {
    $result = _acquia_agent_xmlrpc($ctx, $url, $method, $data);
  }
  if ($errno = xmlrpc_errno()) {
    watchdog('acquia agent', '@message (@errno): %server - %method - <pre>@data</pre>', array(
      '@message' => xmlrpc_error_msg(),
      '@errno' => xmlrpc_errno(),
      '%server' => $url,
      '%method' => $method,
      '@data' => print_r($data, TRUE),
    ), WATCHDOG_ERROR);
  }
  return $result;
}