commit 281d6292a7c30a72adcc99fa811b8d4265a7c5cd Author: Erik Stielstra Date: Sat Jun 29 00:27:05 2013 +0100 #3 diff --git a/core/includes/project.inc b/core/includes/project.inc index df9c50c..fd1886f 100644 --- a/core/includes/project.inc +++ b/core/includes/project.inc @@ -133,7 +133,7 @@ function drupal_project_process_info_list(&$projects, $list, $project_type, $sta 'name' => $project_name, // Only save attributes from the .info.yml file we care about so we do // not bloat our RAM usage needlessly. - 'info' => update_filter_project_info($file->info, $additional_whitelist), + 'info' => drupal_project_filter_project_info($file->info, $additional_whitelist), 'datestamp' => $file->info['datestamp'], 'includes' => array($file->name => $file->info['name']), 'project_type' => $project_display_type, @@ -240,3 +240,32 @@ function drupal_project_process_project_info(&$projects) { $projects[$key]['install_type'] = $install_type; } } + +/** + * Filters the project .info.yml data to only save attributes we need. + * + * @param array $info + * Array of .info.yml file data as returned by drupal_parse_info_file(). + * @param $additional_whitelist + * (optional) Array of additional elements to be collected from the .info.yml + * file. Defaults to array(). + * + * @return + * Array of .info.yml file data we need for the update manager. + * + * @see drupal_project_process_info_list(drupal_project_process_info_list + */ +function drupal_project_filter_project_info($info, $additional_whitelist = array()) { + $whitelist = array( + '_info_file_ctime', + 'datestamp', + 'major', + 'name', + 'package', + 'project', + 'project status url', + 'version', + ); + $whitelist = array_merge($whitelist, $additional_whitelist); + return array_intersect_key($info, drupal_map_assoc($whitelist)); +} diff --git a/core/modules/update/update.compare.inc b/core/modules/update/update.compare.inc index 3b53b40..072d67b 100644 --- a/core/modules/update/update.compare.inc +++ b/core/modules/update/update.compare.inc @@ -571,32 +571,3 @@ function update_project_storage($key) { } return $projects; } - -/** - * Filters the project .info.yml data to only save attributes we need. - * - * @param array $info - * Array of .info.yml file data as returned by drupal_parse_info_file(). - * @param $additional_whitelist - * (optional) Array of additional elements to be collected from the .info.yml - * file. Defaults to array(). - * - * @return - * Array of .info.yml file data we need for the update manager. - * - * @see update_process_info_list(drupal_project_process_info_list - */ -function update_filter_project_info($info, $additional_whitelist = array()) { - $whitelist = array( - '_info_file_ctime', - 'datestamp', - 'major', - 'name', - 'package', - 'project', - 'project status url', - 'version', - ); - $whitelist = array_merge($whitelist, $additional_whitelist); - return array_intersect_key($info, drupal_map_assoc($whitelist)); -}