You are here

function acquia_spi_handle_server_response in Acquia Connector 6.2

Same name and namespace in other branches
  1. 7.3 acquia_spi/acquia_spi.module \acquia_spi_handle_server_response()
  2. 7.2 acquia_spi/acquia_spi.module \acquia_spi_handle_server_response()

Act on SPI update server response.

Parameters

array $spi_response Array response from acquia_spi_send_data().:

1 call to acquia_spi_handle_server_response()
acquia_spi_send_full_spi in acquia_spi/acquia_spi.module
Gather full SPI data and send to Acquia Insight.

File

acquia_spi/acquia_spi.module, line 362
Send site profile information (NSPI) and system data to Acquia Insight.

Code

function acquia_spi_handle_server_response($spi_response) {

  // Check result for command to update SPI definition.
  $update = isset($spi_response['result']['update_spi_definition']) ? $spi_response['result']['update_spi_definition'] : FALSE;
  if ($update === TRUE) {
    acquia_spi_update_definition();
  }

  // Check for set_variables command.
  $set_variables = isset($spi_response['set_variables']) ? $spi_response['set_variables'] : FALSE;
  if ($set_variables !== FALSE) {
    acquia_spi_set_variables($set_variables);
  }

  // Log messages.
  $messages = isset($spi_response['nspi_messages']) ? $spi_response['nspi_messages'] : FALSE;
  if ($messages !== FALSE) {
    watchdog('acquia spi', 'SPI update server response messages: @messages', array(
      '@messages' => implode(', ', $messages),
    ));
  }
}