Revision 66c08b64
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/DBUpgrade2.pm | ||
---|---|---|
235 | 235 |
|
236 | 236 |
# Process a Perl script which updates the database. |
237 | 237 |
# If the script returns 1 then the update was successful. |
238 |
# Return code "2" means "needs more interaction; remove
|
|
239 |
# users/nologin and end current request".
|
|
238 |
# Return code "2" means "needs more interaction; unlock
|
|
239 |
# the system and end current request".
|
|
240 | 240 |
# All other return codes are fatal errors. |
241 | 241 |
sub process_perl_script { |
242 | 242 |
$::lxdebug->enter_sub(); |
... | ... | |
266 | 266 |
print $::form->parse_html_template("dbupgrade/error", { file => $filename, error => $error }); |
267 | 267 |
::end_of_request(); |
268 | 268 |
} elsif (1 != $result) { |
269 |
unlink("users/nologin") if (2 == $result);
|
|
269 |
SL::System::InstallationLock->unlock if 2 == $result;
|
|
270 | 270 |
::end_of_request(); |
271 | 271 |
} |
272 | 272 |
|
... | ... | |
469 | 469 |
form => $::form, |
470 | 470 |
auth => 1 |
471 | 471 |
); |
472 |
User->dbupdate2($form, $scripts->parse_dbupdate_controls); |
|
472 |
User->dbupdate2(form => $form, |
|
473 |
updater => $scripts->parse_dbupdate_controls, |
|
474 |
database => $dbname); |
|
473 | 475 |
|
474 | 476 |
=head1 OVERVIEW |
475 | 477 |
|
... | ... | |
638 | 640 |
Perl scripts are executed via L<eval>. If L<eval> returns falsish then |
639 | 641 |
an error is expected. There are two special return values: If the |
640 | 642 |
script returns C<1> then the update was successful. Return code C<2> |
641 |
means "needs more interaction from the user; remove users/nologin and
|
|
643 |
means "needs more interaction from the user; unlock the system and
|
|
642 | 644 |
end current upgrade process". All other return codes are fatal errors. |
643 | 645 |
|
644 | 646 |
Inside the Perl script several local variables exist that can be used: |
Auch abrufbar als: Unified diff
Locking in eigenes Modul verschieben