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.
$reset Set to TRUE after modifying the system table.
$array Set to TRUE if you want to get information about all modules in the system.
Return value
The currently installed schema version.
Code
includes/install.inc, line 71
<?php
function drupal_get_installed_schema_version($module, $reset = FALSE, $array = FALSE) {
static $versions = array();
if ($reset) {
$versions = array();
}
if (!$versions) {
$versions = array();
$result = db_query("SELECT name, schema_version FROM {system} WHERE type = '%s'", 'module');
while ($row = db_fetch_object($result)) {
$versions[$row->name] = $row->schema_version;
}
}
return $array ? $versions : $versions[$module];
}
?>Login or register to post comments 