- Patch #40518 by drumm: remove hook_versions.
parent
adcbc9b957
commit
1d0fa04d33
|
@ -1,19 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id$
|
// $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() {
|
function system_update_110() {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
|
||||||
|
|
|
@ -27,13 +27,16 @@ foreach (module_list() as $module) {
|
||||||
* FALSE.
|
* FALSE.
|
||||||
*/
|
*/
|
||||||
function drupal_get_schema_versions($module) {
|
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;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (!($min = module_invoke($module, 'version', SCHEMA_MIN))) {
|
return $updates;
|
||||||
$min = 1;
|
|
||||||
}
|
|
||||||
return range($min, $max);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue