You are here

function drupal_get_schema_versions in Drupal 6

Same name and namespace in other branches
  1. 8 core/includes/schema.inc \drupal_get_schema_versions()
  2. 4 includes/install.inc \drupal_get_schema_versions()
  3. 5 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 sorted by version. Otherwise, FALSE.

5 calls to drupal_get_schema_versions()
drupal_install_system in includes/install.inc
Callback to install the system module.
system_requirements in modules/system/system.install
Implementation of hook_requirements().
update_batch in ./update.php
update_script_selection_form in ./update.php
_drupal_install_module in includes/install.inc
Callback to install an individual profile module.

File

includes/install.inc, line 40

Code

function drupal_get_schema_versions($module) {
  $updates = array();
  $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;
  }
  sort($updates, SORT_NUMERIC);
  return $updates;
}