summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-09-17 02:28:37 +0000
committerDries Buytaert <dries@buytaert.net>2010-09-17 02:28:37 +0000
commit1bb8993aad4cbf9bb0852cf0830453fe62f92c8c (patch)
tree0bd928826f674c0ca6c1f811703ca3d4a9c138c6
parent5d44ff337db9185b88c09a2d234ac08c89f359ce (diff)
downloadbrdo-1bb8993aad4cbf9bb0852cf0830453fe62f92c8c.tar.gz
brdo-1bb8993aad4cbf9bb0852cf0830453fe62f92c8c.tar.bz2
- Patch #909272 by moshe weitzman, David_Rothstein: remove stub update functions and renumber the remaining ones.
-rw-r--r--includes/update.inc22
-rw-r--r--modules/locale/locale.install3
-rw-r--r--modules/system/system.install28
-rw-r--r--modules/user/user.install1
4 files changed, 39 insertions, 15 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;
+ }
}
}
}
diff --git a/modules/locale/locale.install b/modules/locale/locale.install
index 80dbab9a8..1c32d58b7 100644
--- a/modules/locale/locale.install
+++ b/modules/locale/locale.install
@@ -105,9 +105,10 @@ function locale_update_7001() {
/**
* Allow longer javascript file names.
+ *
+ * Moved to update_fix_d7_requirements().
*/
function locale_update_7002() {
- // Update moved to update_fix_d7_requirements().
}
/**
diff --git a/modules/system/system.install b/modules/system/system.install
index 858e576e5..ab45effe2 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -1866,9 +1866,10 @@ function system_update_7005() {
/**
* Registry tables and drop the file key of the menu router, since it is no
* longer needed.
+ *
+ * Moved to update_fix_d7_requirements().
*/
function system_update_7006() {
- // Update moved to update_fix_d7_requirements().
}
/**
@@ -1900,9 +1901,10 @@ function system_update_7007() {
/**
* Use the poll_choice primary key to record votes in poll_votes rather than
* the choice order. Rename chorder to weight.
+ *
+ * Moved to poll_update_7001().
*/
function system_update_7008() {
- // Moved to poll_update_7001().
}
/**
@@ -1920,7 +1922,6 @@ function system_update_7009() {
* Moved to system_update_6048().
*/
function system_update_7010() {
- return '';
}
/**
@@ -1944,7 +1945,11 @@ function system_update_7011() {
$insert->execute();
}
-// system_update_7012() moved to block_update_7002().
+/**
+ * Moved to block_update_7002().
+ */
+function system_update_7012() {
+}
/**
* Convert default time zone offset to default time zone name.
@@ -2126,7 +2131,11 @@ function system_update_7027() {
module_enable($module_list, FALSE);
}
-// system_update_7028() moved to taxonomy_update_7001().
+/**
+ * Moved to taxonomy_update_7001().
+ */
+function system_update_7028() {
+}
/**
* Add new 'view own unpublished content' permission for authenticated users.
@@ -2301,24 +2310,27 @@ function system_update_7037() {
/**
* Adds fields to the {menu_router} table to allow custom themes to be set per
* page.
+ *
+ * Moved to update_fix_d7_requirements().
*/
function system_update_7039() {
- // Moved to update_fix_d7_requirements().
}
/**
* Create new date format tables.
+ *
+ * Moved to update_fix_d7_requirements().
*/
function system_update_7040() {
- // Moved to update_fix_d7_requirements().
}
/**
* Adds 'delivery_callback' field to the {menu_router} table to allow a custom
* function to be used for final page rendering and sending to browser.
+ *
+ * Moved to update_fix_d7_requirements().
*/
function system_update_7041() {
- // Moved to update_fix_d7_requirements().
}
/**
diff --git a/modules/user/user.install b/modules/user/user.install
index d3ec23740..d75fe10f4 100644
--- a/modules/user/user.install
+++ b/modules/user/user.install
@@ -551,7 +551,6 @@ function user_update_7003() {
* Moved to user_update_7012().
*/
function user_update_7004() {
- // This doesn't affect any subsequent user updates.
}
/**