You are here

function drupal_get_schema_versions in Drupal 4

Same name and namespace in other branches
  1. 8 core/includes/schema.inc \drupal_get_schema_versions()
  2. 5 includes/install.inc \drupal_get_schema_versions()
  3. 6 includes/install.inc \drupal_get_schema_versions()
  4. 7 includes/install.inc \drupal_get_schema_versions()
  5. 9 core/includes/schema.inc \drupal_get_schema_versions()

Returns an array of available schema versions for a module.

Parameters

$module: A module name.

Return value

If the module has updates, an array of available updates. Otherwise, FALSE.

4 calls to drupal_get_schema_versions()
system_modules_submit in modules/system.module
update_selection_page in ./update.php
update_update_page in ./update.php
user_register_submit in modules/user.module

File

includes/install.inc, line 28

Code

function drupal_get_schema_versions($module) {
  $functions = get_defined_functions();
  foreach ($functions['user'] as $function) {
    if (strpos($function, $module . '_update_') === 0) {
      $version = substr($function, strlen($module . '_update_'));
      if (is_numeric($version)) {
        $updates[] = $version;
      }
    }
  }
  if (count($updates) == 0) {
    return FALSE;
  }
  return $updates;
}