You are here

function _configuration_sanitize in Configuration Management 7

"Sanitizes" an array recursively, performing two key operations:

  • Sort an array by its keys (assoc) or values (non-assoc)
  • Remove any null or empty values for associative arrays (array_filter()).
1 call to _configuration_sanitize()
configuration_get_signature in ./configuration.export.inc
Wrapper around configuration_get_[storage] to return an md5hash of a normalized defaults/normal object array. Can be used to compare normal/default states of a module's component.

File

./configuration.export.inc, line 747

Code

function _configuration_sanitize(&$array) {
  if (is_array($array)) {
    if (_configuration_is_assoc($array)) {
      ksort($array);
      $array = array_filter($array);
    }
    else {
      sort($array);
    }
    foreach ($array as $k => $v) {
      if (is_array($v)) {
        _configuration_sanitize($array[$k]);
      }
    }
  }
}