| Versionen | |
|---|---|
| drupal6 – drupal7 | drupal_get_installed_schema_version($module, $reset = FALSE, $array = FALSE) |
Returns the currently installed schema version for a module.
$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.
The currently installed schema version.
includes/
<?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];
}
?>
Kommentare
Kommentar hinzufügen