drupal_get_schema_versions

Versions
4.7 – 7
drupal_get_schema_versions($module)

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.

Code

includes/install.inc, line 28

<?php
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;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.