diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-09-17 02:28:37 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-09-17 02:28:37 +0000 |
commit | 1bb8993aad4cbf9bb0852cf0830453fe62f92c8c (patch) | |
tree | 0bd928826f674c0ca6c1f811703ca3d4a9c138c6 /includes | |
parent | 5d44ff337db9185b88c09a2d234ac08c89f359ce (diff) | |
download | brdo-1bb8993aad4cbf9bb0852cf0830453fe62f92c8c.tar.gz brdo-1bb8993aad4cbf9bb0852cf0830453fe62f92c8c.tar.bz2 |
- Patch #909272 by moshe weitzman, David_Rothstein: remove stub update functions and renumber the remaining ones.
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; + } } } } |