You are here

function acquia_agent_network_address in Acquia Connector 6

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

Helper function to build the xmlrpc target address.

4 calls to acquia_agent_network_address()
acquia_agent_call in acquia_agent/acquia_agent.module
Prepare and send a XML-RPC request to Acquia Network with an authenticator.
_acquia_agent_an_trial_pass_old_form_validate in acquia_agent/acquia_agent.pages.inc
_acquia_agent_an_trial_start_form_submit in acquia_agent/acquia_agent.pages.inc
_acquia_agent_call_provision_freetrial in acquia_agent/acquia_agent.pages.inc
Helper function that creates a new AN subscription via xmlrpc call. It stores id/key if success and sets page error otherwise

File

acquia_agent/acquia_agent.module, line 421
Acquia Agent securely sends information to Acquia Network.

Code

function acquia_agent_network_address($acquia_network_address = NULL) {
  if (empty($acquia_network_address)) {
    $acquia_network_address = acquia_agent_settings('acquia_network_address');
  }

  // Strip protocol (scheme) from Network address
  $uri = parse_url($acquia_network_address);
  $port = isset($uri['port']) ? ':' . $uri['port'] : '';
  $path = isset($uri['path']) ? $uri['path'] : '';
  $acquia_network_address = $uri['host'] . $port . $path;

  // Add a scheme based on PHP's capacity.
  if (in_array('ssl', stream_get_transports(), TRUE) && !defined('ACQUIA_DEVELOPMENT_NOSSL')) {

    // OpenSSL is available in PHP
    $acquia_network_address = 'https://' . $acquia_network_address;
  }
  else {
    $acquia_network_address = 'http://' . $acquia_network_address;
  }
  $acquia_network_address .= '/xmlrpc.php';
  return $acquia_network_address;
}