List all fields with the feature they are defined in I'm interested in generating a list of all fields with a column highlighting the feature that contains the field base setting and another column highlighting the field instance feature, (if the field is defined in a feature).

Something like this...


Field Name     |   Field Base Defined In  | Field Instance Defined In
field_subtitle |   mysite_shared_fields   | blog_story_feature
field_other    |   mysite_shared_fields   | blog_story_feature


Has anyone attempted this? Or can anyone suggest a solution.
Some useful functions /snippets below

field_info_instances();

$features_map = features_get_component_map();

$features_map['field_base'];
$features_map['field_instance'];
return;
foreach (field_info_fields() as $key =&gt; $field) {
  $base = isset($features_map['field_base'][$key]) ? join(',',$features_map['field_base'][$key]) : 'NOT IN A FEATURE!';
  $instance = 'todo';
  $rows[] = array($key, $base, $instance);
}
print theme('table', array('header' =&gt; array('machine_name', 'base', 'instance'), 'rows' =&gt; $rows));
return;

$components = features_get_components();
$field_base_component = $components['field_base'];
features_include_defaults($field_base_component);
$field_instance_components = $components['field_instance'];