You are here

function _imageapi_optimize_features_pipeline_sanitize in Image Optimize (or ImageAPI Optimize) 7.2

Remove unnecessary keys for export.

1 call to _imageapi_optimize_features_pipeline_sanitize()
imageapi_optimize_features_export_render in ./imageapi_optimize.features.inc
Implements hook_features_export_render().

File

./imageapi_optimize.features.inc, line 94
Features integration for the ImageAPI Optimize module.

Code

function _imageapi_optimize_features_pipeline_sanitize(array &$pipeline) {

  // Sanitize style: Don't export numeric IDs and things which get overwritten
  // in imageapi_optimize_processors() or are code/storage specific. The name property will be
  // the key of the exported $pipeline array.
  $pipeline = array_diff_key($pipeline, array_flip(array(
    'isid',
    'name',
    'module',
    'storage',
  )));

  // Sanitize processors: all that needs to be kept is name, weight and data,
  // which holds all the processor-specific configuratison. Other keys are assumed
  // to belong to the definition of the processor itself, so not configuration.
  foreach ($pipeline['processors'] as $id => $processor) {
    $pipeline['processors'][$id] = array_intersect_key($processor, array_flip(array(
      'name',
      'data',
      'weight',
    )));
  }
}