RSS

(root)/drupal/6 : 11 : modules/update/update.compare.inc

Ā« back to all changes in this revision

Viewing changes to modules/update/update.compare.inc

David Strauss
2010-03-04 01:32:05
Revision ID: david@fourkitchens.com-20100304013205-rzm7nzx405tybf1o
Tags: DRUPAL-6-16
DrupalĀ 6.16

Show diffs side-by-side

added added

removed removed

1
1
<?php
2
 
// $Id: update.compare.inc,v 1.8.2.7 2009/11/06 07:26:21 goba Exp $
 
2
// $Id: update.compare.inc,v 1.8.2.8 2010/03/01 09:40:45 goba Exp $
3
3
 
4
4
/**
5
5
 * @file
124
124
      // project can have multiple modules or themes.
125
125
      $projects[$project_name] = array(
126
126
        'name' => $project_name,
127
 
        'info' => $file->info,
 
127
        // Only save attributes from the .info file we care about so we do not
 
128
        // bloat our RAM usage needlessly.
 
129
        'info' => update_filter_project_info($file->info),
128
130
        'datestamp' => $file->info['datestamp'],
129
131
        'includes' => array($file->name => $file->info['name']),
130
132
        'project_type' => $project_name == 'drupal' ? 'core' : $project_type,
667
669
  }
668
670
  return $projects;
669
671
}
 
672
 
 
673
/**
 
674
 * Filter the project .info data to only save attributes we need.
 
675
 *
 
676
 * @param array $info
 
677
 *   Array of .info file data as returned by drupal_parse_info_file().
 
678
 *
 
679
 * @return
 
680
 *   Array of .info file data we need for the Update manager.
 
681
 *
 
682
 * @see _update_process_info_list()
 
683
 */
 
684
function update_filter_project_info($info) {
 
685
  $whitelist = array(
 
686
    '_info_file_ctime',
 
687
    'datestamp',
 
688
    'major',
 
689
    'name',
 
690
    'package',
 
691
    'project',
 
692
    'project status url',
 
693
    'version', 
 
694
  );
 
695
  return array_intersect_key($info, drupal_map_assoc($whitelist));
 
696
}

Loggerhead 1.17 is a web-based interface for Bazaar branches