You are here

function _acquia_spi_json in Acquia Connector 6.2

Helper function checks for PHP 5.2's json_encode or fallback to core.

2 calls to _acquia_spi_json()
acquia_spi_get in acquia_spi/acquia_spi.module
Gather site profile information about this site.
acquia_spi_get_variables_data in acquia_spi/acquia_spi.module
get all system variables

File

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

Code

function _acquia_spi_json($var) {
  if (function_exists('json_encode')) {
    return str_replace(array(
      '<',
      '>',
      '&',
    ), array(
      '\\u003c',
      '\\u003e',
      '\\u0026',
    ), json_encode($var));
  }
  else {
    return drupal_to_js($var);
  }
}