Skip to content
Snippets Groups Projects
Commit c671e6b9 authored by Angie Byron's avatar Angie Byron
Browse files

#669554 by dww: Reduce RAM bloat: only save attributes from .info we care about in Update module.

parent 7e1fda54
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -174,7 +174,9 @@ function _update_process_info_list(&$projects, $list, $project_type, $status) {
// project can have multiple modules or themes.
$projects[$project_name] = array(
'name' => $project_name,
'info' => $file->info,
// Only save attributes from the .info file we care about so we do not
// bloat our RAM usage needlessly.
'info' => update_filter_project_info($file->info),
'datestamp' => $file->info['datestamp'],
'includes' => array($file->name => $file->info['name']),
'project_type' => $project_display_type,
......@@ -740,3 +742,29 @@ function update_project_cache($cid) {
}
return $projects;
}
/**
* Filter the project .info data to only save attributes we need.
*
* @param array $info
* Array of .info file data as returned by drupal_parse_info_file().
*
* @return
* Array of .info file data we need for the Update manager.
*
* @see _update_process_info_list()
*/
function update_filter_project_info($info) {
$whitelist = array(
'_info_file_ctime',
'datestamp',
'hidden',
'major',
'name',
'package',
'project',
'project status url',
'version',
);
return array_intersect_key($info, drupal_map_assoc($whitelist));
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment