You are here

function apachesolr_environment_conf_equals in Apache Solr Search 7

Determines whether two configuration arrays contain the same keys and values.

This is used to compare in-code and in-database configuration of ctools exportables.

Parameters

array $conf1: First configuration array.

array $conf2: Second configuration array.

bool $ignore_state: Whether to ignore state variables, such as `apachesolr_index_last`, `apachesolr_index_updated`, `apachesolr_last_optimize_success` and `apachesolr_last_optimize_attempt`

Return value

TRUE if both arrays are considered equal, FALSE otherwise.

See also

apachesolr_environment_load_subrecords()

1 call to apachesolr_environment_conf_equals()
apachesolr_environment_load_subrecords in ./apachesolr.module
Export callback to load the view subrecords, which are the index bundles.

File

./apachesolr.module, line 2954
Integration with the Apache Solr search application.

Code

function apachesolr_environment_conf_equals(array $conf1, array $conf2, $ignore_state = TRUE) {
  if ($ignore_state === TRUE) {

    // Strip out state variables before comparing both arrays.
    $state_variables = apachesolr_environment_conf_state_variables();
    $conf1 = array_diff_key($conf1, $state_variables);
    $conf2 = array_diff_key($conf2, $state_variables);
  }
  return $conf1 === $conf2;
}