Commit 1d0fa04d authored by Dries's avatar Dries
Browse files

- Patch #40518 by drumm: remove hook_versions.

parent adcbc9b9
<?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();
......
......@@ -27,13 +27,16 @@
* FALSE.
*/
function drupal_get_schema_versions($module) {
if (!($max = module_invoke($module, 'version', SCHEMA))) {
return FALSE;
$functions = get_defined_functions();
foreach ($functions['user'] as $function) {
if (strpos($function, $module .'_update') === 0) {
$updates[] = (int) substr($function, strlen($module .'_update_'));
}
}
if (!($min = module_invoke($module, 'version', SCHEMA_MIN))) {
$min = 1;
if (count($updates) == 0) {
return FALSE;
}
return range($min, $max);
return $updates;
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment