function drupal_get_schema_versions in Drupal 5
Same name and namespace in other branches
- 8 core/includes/schema.inc \drupal_get_schema_versions()
- 4 includes/install.inc \drupal_get_schema_versions()
- 6 includes/install.inc \drupal_get_schema_versions()
- 7 includes/install.inc \drupal_get_schema_versions()
- 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_modules in includes/
install.inc - Calls the install function and updates the system table for a given list of modules.
- drupal_install_profile in includes/
install.inc - Install a profile (i.e. a set of modules) from scratch. The profile must be verified first using drupal_verify_profile().
- system_requirements in modules/
system/ system.install - Test and report Drupal installation requirements.
- update_script_selection_form in ./
update.php - update_update_page in ./
update.php
File
- includes/
install.inc, line 38
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;
}