Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7e0ad798

Von Moritz Bunkus vor fast 14 Jahren hinzugefügt

  • ID 7e0ad798bc842b710a27b0e1a7a720b117b2566a
  • Vorgänger a97d97a0
  • Nachfolger a1d1605e

Umstellung DBUpgrade2-Modul auf Objekt-Aufrufsyntax

Unterschiede anzeigen:

SL/User.pm
125 125

  
126 126
    $rc = 0;
127 127

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

  
131 131
    map({ $form->{$_} = $myconfig{$_} }
132 132
        qw(dbname dbhost dbport dbdriver dbuser dbpasswd dbconnect dateformat));
......
163 163
      $SIG{QUIT} = 'IGNORE';
164 164

  
165 165
      $self->dbupdate($form);
166
      $self->dbupdate2($form, $controls);
166
      $self->dbupdate2($form, $dbupdater);
167 167

  
168 168
      close(FH);
169 169

  
......
622 622
  my ($self, $form) = @_;
623 623

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

  
627 627
  my ($query, $sth, %dbs_needing_updates);
628 628

  
......
826 826
sub dbupdate2 {
827 827
  $main::lxdebug->enter_sub();
828 828

  
829
  my ($self, $form, $controls) = @_;
829
  my ($self, $form, $dbupdater) = @_;
830 830

  
831 831
  $form->{sid} = $form->{dbdefault};
832 832

  
......
834 834
  my ($query, $sth, $tag);
835 835
  my $rc = -2;
836 836

  
837
  @upgradescripts = sort_dbupdate_controls($controls);
837
  @upgradescripts = $dbupdater->sort_dbupdate_controls;
838 838

  
839 839
  my $db_charset = $main::dbcharset;
840 840
  $db_charset ||= Common::DEFAULT_CHARSET;
......
861 861
    $sth = $dbh->prepare($query);
862 862
    $sth->execute() || $form->dberror($query);
863 863
    while (($tag) = $sth->fetchrow_array()) {
864
      $controls->{$tag}->{"applied"} = 1 if (defined($controls->{$tag}));
864
      $dbupdater->{all_controls}->{$tag}->{"applied"} = 1 if (defined($dbupdater->{all_controls}->{$tag}));
865 865
    }
866 866
    $sth->finish();
867 867

  

Auch abrufbar als: Unified diff