//
// Apply one differential data set.
//
-function upgrade_step($index, $company, $conn)
+function upgrade_step($inst, $company, $conn, $force)
{
- global $path_to_root, $installers;
+ global $path_to_root;
- $inst = $installers[$index];
$pref = $conn['tbpref'];
$ret = true;
- $force = get_post('force_'.$index);
- if ($force || get_post('install_'.$index))
- {
$state = $inst->installed($pref);
if (!$state || $force)
{
display_error(_("Upgrade cannot be done because database has been already partially upgraded. Please downgrade database to clean previous version or try forced upgrade."));
$ret = false;
}
- }
return $ret;
}
// apply all upgrade data
foreach ($installers as $i => $inst)
{
- $ret = upgrade_step($i, $comp, $conn);
+
+ $force = get_post('force_'.$i);
+ if ($force || get_post('install_'.$i))
+ $ret = upgrade_step($installers[$i], $comp, $conn, $force);
+
if (!$ret)
{
display_error(
end_page();
-?>
\ No newline at end of file