- Patch #40518 by drumm: remove hook_versions.

4.7.x
Dries Buytaert 2005-12-09 15:46:47 +00:00
parent adcbc9b957
commit 1d0fa04d33
2 changed files with 8 additions and 18 deletions

View File

@ -1,19 +1,6 @@
<?php
// $Id$
// SCHEMA and SCHEMA_MIN represent the minimum and maximum N modulename_update_N.
// Update SCHEMA when a new update function is added. Update SCHEMA_MIN when old
// update functions are removed.
function system_version($type) {
switch ($type) {
case SCHEMA:
return 159;
case SCHEMA_MIN:
return 110;
}
}
function system_update_110() {
$ret = array();

View File

@ -27,13 +27,16 @@ foreach (module_list() as $module) {
* FALSE.
*/
function drupal_get_schema_versions($module) {
if (!($max = module_invoke($module, 'version', SCHEMA))) {
$functions = get_defined_functions();
foreach ($functions['user'] as $function) {
if (strpos($function, $module .'_update') === 0) {
$updates[] = (int) substr($function, strlen($module .'_update_'));
}
}
if (count($updates) == 0) {
return FALSE;
}
if (!($min = module_invoke($module, 'version', SCHEMA_MIN))) {
$min = 1;
}
return range($min, $max);
return $updates;
}
/**