diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/update.inc | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/includes/update.inc b/includes/update.inc index ff7fc696c..c4efc1b7d 100644 --- a/includes/update.inc +++ b/includes/update.inc @@ -992,15 +992,27 @@ function update_get_update_list() { continue; } + $last_file_name = NULL; $updates = drupal_map_assoc($updates); foreach (array_keys($updates) as $update) { if ($update > $schema_version) { - // The description for an update comes from its Doxygen. + // Omit stub functions that just carry doxygen for developers. $func = new ReflectionFunction($module . '_update_' . $update); - $description = str_replace(array("\n", '*', '/'), '', $func->getDocComment()); - $ret[$module]['pending'][$update] = "$update - $description"; - if (!isset($ret[$module]['start'])) { - $ret[$module]['start'] = $update; + // Only read file contents once per .install file. + $current_file_name = $func->getFileName(); + if ($current_file_name != $last_file_name) { + $file = file($current_file_name); + $last_file_name = $current_file_name; + } + // Slice out just the body of the function. + $body = array_slice($file, $func->getStartLine(), ($func->getEndLine() - $func->getStartLine()-1)); + if (trim(implode('', $body))) { + // The description for an update comes from its Doxygen. + $description = str_replace(array("\n", '*', '/'), '', $func->getDocComment()); + $ret[$module]['pending'][$update] = "$update - $description"; + if (!isset($ret[$module]['start'])) { + $ret[$module]['start'] = $update; + } } } } |