$default) { $default = $update; break; } } $start[$module] = $default; } } $update_results = array(); foreach ($start as $module => $version) { drupal_set_installed_schema_version($module, $version - 1); $updates = drupal_get_schema_versions($module); $max_version = max($updates); if ($version <= $max_version) { provision_log('notice', pt('Updating module @module from schema version @start to schema version @max', array('@module' => $module, '@start' => $version - 1, '@max' => $max_version))); foreach ($updates as $update) { $finished = FALSE; if ($update >= $version) { while (!$finished) { // do update $ret = module_invoke($module, 'update_' . $update); // Assume the update finished unless the update results indicate otherwise. foreach ($ret as $info) { if (!$info['success']) { provision_set_error('PROVISION_DB_ERROR'); } provision_log( ($info['success']) ? 'success' : 'error', $info['query']); } $finished = 1; if (isset($ret['#finished'])) { $finished = $ret['#finished']; unset($ret['#finished']); } } drupal_set_installed_schema_version($module, $update); } } } else { provision_log("notice", pt('No updates for @module module', array('@module' => $module))); } } } update_main($url, $data); provision_output($url, $data);