Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 486fe464

Von Moritz Bunkus vor fast 14 Jahren hinzugefügt

  • ID 486fe464fc69883e89ce37518473bfb688354d6f
  • Vorgänger 626ec4b4
  • Nachfolger 2da6fbfb

Admin-DB-Upgrade-Funktion nach DBUpgrade2 verschoben

Unterschiede anzeigen:

bin/mozilla/admin.pl
1167 1167
}
1168 1168

  
1169 1169
sub _apply_dbupgrade_scripts {
1170
  my $dbh               = $::auth->dbconnect;
1171
  my $dbdriver          = 'Pg';
1172
  my $dbupdater         = SL::DBUpgrade2->new(form => $::form, dbdriver => $dbdriver, auth => 1)->parse_dbupdate_controls;
1173
  my @unapplied_scripts = $dbupdater->unapplied_upgrade_scripts($dbh);
1174

  
1175
  return if !@unapplied_scripts;
1176

  
1177
  my $db_charset = $main::dbcharset || Common::DEFAULT_CHARSET;
1178
  $form->{login} = 'admin';
1179

  
1180
  map { $_->{description} = SL::Iconv::convert($_->{charset}, $db_charset, $_->{description}) } values %{ $dbupdater->{all_controls} };
1181

  
1182
  $form->{title} = $::locale->text('Dataset upgrade');
1183
  $form->header;
1184
  print $form->parse_html_template("dbupgrade/header", { dbname => $::auth->{DB_config}->{db} });
1185

  
1186
  foreach my $control (@unapplied_scripts) {
1187
    $::lxdebug->message(LXDebug->DEBUG2(), "Applying Update $control->{file}");
1188
    print $form->parse_html_template("dbupgrade/upgrade_message2", $control);
1189

  
1190
    $dbupdater->process_file($dbh, "sql/${dbdriver}-upgrade2-auth/$control->{file}", $control, $db_charset);
1191
  }
1192

  
1193
  print $form->parse_html_template("dbupgrade/footer", { is_admin => 1, menufile => 'admin.pl' });
1194
  ::end_of_request();
1170
  SL::DBUpgrade2->new(form => $::form, dbdriver => 'Pg', auth => 1)->parse_dbupdate_controls->apply_admin_dbupgrade_scripts(1);
1195 1171
}
1196 1172

  
1197 1173
1;

Auch abrufbar als: Unified diff