drupal_get_installed_schema_version

Versions
4.7 – 5
drupal_get_installed_schema_version($module, $reset = FALSE)
6 – 7
drupal_get_installed_schema_version($module, $reset = FALSE, $array = FALSE)

Returns the currently installed schema version for a module.

Parameters

$module A module name.

Return value

The currently installed schema version.

▾ 7 functions call drupal_get_installed_schema_version()

drupal_install_modules in includes/install.inc
Calls the install function and updates the system table for a given list of modules.
system_modules_submit in modules/system/system.module
Submit callback; handles modules form submission.
system_requirements in modules/system/system.install
Test and report Drupal installation requirements.
update_fix_sessions in ./update.php
System update 130 changes the sessions table, which breaks the update script's ability to use session variables. This changes the table appropriately.
update_fix_watchdog in ./update.php
System update 142 changes the watchdog table, which breaks the update script's ability to use logging. This changes the table appropriately.
update_fix_watchdog_115 in ./update.php
System update 115 changes the watchdog table, which breaks the update script's ability to use logging. This changes the table appropriately.
update_script_selection_form in ./update.php

Code

includes/install.inc, line 64

<?php
function drupal_get_installed_schema_version($module, $reset = FALSE) {
  static $versions = array();

  if ($reset) {
    $versions = array();
  }

  if (!$versions) {
    $versions = array();
    $result = db_query("SELECT name, schema_version FROM {system} WHERE type = 'module'");
    while ($row = db_fetch_object($result)) {
      $versions[$row->name] = $row->schema_version;
    }
  }

  return $versions[$module];
}
?>
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.