You are here

function variable_features_export in Strongarm 7.2

Same name and namespace in other branches
  1. 6.2 strongarm.module \variable_features_export()

Implements hook_features_export().

This is implemented to remove variables that are in code, but not DB. This is a result of Strongarm vars now living in the DB, so unlike other ctools components, an update of this Feature with a variable in code but not the database, should remove the variable form the Feature.

File

./strongarm.module, line 151

Code

function variable_features_export($data, &$export, $module_name) {

  // First delegate to the Features ctools export
  $pipe = ctools_component_features_export('variable', $data, $export, $module_name);

  // Then remove any vars from the export that are only in code
  $vars = strongarm_vars_load(TRUE, TRUE);
  foreach ($data as $object_name) {
    if (!isset($vars[$object_name]) || !empty($vars[$object_name]->in_code_only)) {
      unset($export['features']['variable'][$object_name]);
    }
  }
  return $pipe;
}