Revision 35636cc2
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
SL/DBUpgrade2.pm | ||
---|---|---|
276 | 276 |
$main::lxdebug->leave_sub(); |
277 | 277 |
} |
278 | 278 |
|
279 |
sub process_file { |
|
280 |
my ($self, $dbh, $filename, $version_or_control, $db_charset) = @_; |
|
281 |
|
|
282 |
if ($filename =~ m/sql$/) { |
|
283 |
$self->process_query($dbh, $filename, $version_or_control, $db_charset); |
|
284 |
} else { |
|
285 |
$self->process_perl_script($dbh, $filename, $version_or_control, $db_charset); |
|
286 |
} |
|
287 |
} |
|
288 |
|
|
279 | 289 |
sub _check_for_loops { |
280 | 290 |
my ($form, $file_name, $controls, $tag, @path) = @_; |
281 | 291 |
|
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
DRY