Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
c671e6b9
Commit
c671e6b9
authored
Dec 29, 2009
by
webchick
Browse files
#669554
by dww: Reduce RAM bloat: only save attributes from .info we care about in Update module.
parent
7e1fda54
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/update/update.compare.inc
View file @
c671e6b9
...
...
@@ -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
));
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment