Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0b6cb3b8

Von Moritz Bunkus vor fast 14 Jahren hinzugefügt

  • ID 0b6cb3b882036db18ce9c283bfaebe3bc483507e
  • Vorgänger 35636cc2
  • Nachfolger d0fb3d4d

new bekommt Hash-Params, nicht positionsbezogene

Unterschiede anzeigen:

SL/DBUpgrade2.pm
8 8
use strict;
9 9

  
10 10
sub new {
11
  my ($package, $form, $dbdriver) = @_;
12
  my $self                        = { form => $form, dbdriver => $dbdriver };
13
  return bless($self, $package);
11
  my $package = shift;
12

  
13
  return bless({}, $package)->init(@_);
14 14
}
15 15

  
16
sub set_dbcharset {
17
  my $self           = shift;
18
  $self->{dbcharset} = shift;
16
sub init {
17
  my ($self, %params) = @_;
18

  
19
  map { $self->{$_} = $params{$_} } keys %params;
20

  
19 21
  return $self;
20 22
}
21 23

  
SL/User.pm
125 125

  
126 126
    $rc = 0;
127 127

  
128
    my $dbupdater = SL::DBUpgrade2->new($form, $myconfig{"dbdriver"});
128
    my $dbupdater = SL::DBUpgrade2->new(form => $form, dbdriver => $myconfig{dbdriver});
129 129
    my $controls  = $dbupdater->parse_dbupdate_controls;
130 130

  
131 131
    map({ $form->{$_} = $myconfig{$_} }
......
395 395
  my $db_charset = $Common::db_encoding_to_charset{$form->{encoding}};
396 396
  $db_charset ||= Common::DEFAULT_CHARSET;
397 397

  
398
  my $dbupdater = SL::DBUpgrade2->new($form, $form->{dbdriver});
398
  my $dbupdater = SL::DBUpgrade2->new(form => $form, dbdriver => $form->{dbdriver});
399 399
  # create the tables
400 400
  $dbupdater->process_query($dbh, "sql/lx-office.sql", undef, $db_charset);
401 401

  
......
457 457
  my ($self, $form) = @_;
458 458

  
459 459
  my %members  = $main::auth->read_all_users();
460
  my $controls = SL::DBUpgrade2->new($form, $form->{dbdriver})->parse_dbupdate_controls;
460
  my $controls = SL::DBUpgrade2->new(form => $form, dbdriver => $form->{dbdriver})->parse_dbupdate_controls;
461 461

  
462 462
  my ($query, $sth, %dbs_needing_updates);
463 463

  
......
597 597
  my $db_charset = $main::dbcharset;
598 598
  $db_charset ||= Common::DEFAULT_CHARSET;
599 599

  
600
  my $dbupdater = SL::DBUpgrade2->new($form, $form->{dbdriver});
600
  my $dbupdater = SL::DBUpgrade2->new(form => $form, dbdriver => $form->{dbdriver});
601 601

  
602 602
  foreach my $db (split(/ /, $form->{dbupdate})) {
603 603

  

Auch abrufbar als: Unified diff