Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 35636cc2

Von Moritz Bunkus vor fast 14 Jahren hinzugefügt

  • ID 35636cc25a82dee3dda2f16891b5e2ef07f72834
  • Vorgänger 8b39e389
  • Nachfolger 0b6cb3b8

DRY

Unterschiede anzeigen:

SL/User.pm
624 624
    foreach my $upgradescript (@upgradescripts) {
625 625
      my $a = $upgradescript;
626 626
      $a =~ s/^\Q$form->{dbdriver}\E-upgrade-|\.(sql|pl)$//g;
627
      my $file_type = $1;
628 627

  
629 628
      my ($mindb, $maxdb) = split /-/, $a;
630 629
      my $str_maxdb = $maxdb;
......
638 637

  
639 638
      # apply upgrade
640 639
      $main::lxdebug->message(LXDebug->DEBUG2(), "Applying Update $upgradescript");
641
      if ($file_type eq "sql") {
642
        $dbupdater->process_query($dbh, "sql/" . $form->{"dbdriver"} . "-upgrade/$upgradescript", $str_maxdb, $db_charset);
643
      } else {
644
        $dbupdater->process_perl_script($dbh, "sql/" . $form->{"dbdriver"} . "-upgrade/$upgradescript", $str_maxdb, $db_charset);
645
      }
640
      $dbupdater->process_file($dbh, "sql/" . $form->{"dbdriver"} . "-upgrade/$upgradescript", $str_maxdb, $db_charset);
646 641

  
647 642
      $version = $maxdb;
648 643

  
......
722 717
      $main::lxdebug->message(LXDebug->DEBUG2(), "Applying Update $control->{file}");
723 718
      print $form->parse_html_template("dbupgrade/upgrade_message2", $control);
724 719

  
725
      if ($file_type eq "sql") {
726
        $dbupdater->process_query($dbh, "sql/" . $form->{"dbdriver"} . "-upgrade2/$control->{file}", $control, $db_charset);
727
      } else {
728
        $dbupdater->process_perl_script($dbh, "sql/" . $form->{"dbdriver"} . "-upgrade2/$control->{file}", $control, $db_charset);
729
      }
720
      $dbupdater->process_file($dbh, "sql/" . $form->{"dbdriver"} . "-upgrade2/$control->{file}", $control, $db_charset);
730 721
    }
731 722

  
732 723
    $rc = 0;

Auch abrufbar als: Unified diff