/[webpac2]/trunk/lib/WebPAC/Output/DBI.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Output/DBI.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1210 by dpavlin, Sat May 30 15:26:25 2009 UTC revision 1211 by dpavlin, Sat May 30 15:34:55 2009 UTC
# Line 43  sub init { Line 43  sub init {
43    
44          $self->{_dbh} = DBI->connect( $self->dsn, $self->user, $self->passwd, { RaiseError => 1 } );          $self->{_dbh} = DBI->connect( $self->dsn, $self->user, $self->passwd, { RaiseError => 1 } );
45    
46          eval {          if ( -e $self->schema ) {
47          $self->{_dbh}->do( scalar read_file( $self->schema ) ) if -e $self->schema;                  foreach my $sql ( split(/;/, scalar read_file( $self->schema )) ) {
48          };                          $log->debug( $sql );
49                            eval { $self->{_dbh}->do( $sql ); };
50                    }
51            }
52    
53          return 1;          return 1;
54  }  }
# Line 124  sub finish { Line 127  sub finish {
127    
128          my $log = $self->_get_logger();          my $log = $self->_get_logger();
129    
130          $log->info('finish and dump data into database');          $log->info('finish');
131    
132          warn dump( $self->{_rows} );  #       warn dump( $self->{_rows} );
133    
134          return 1;          return 1;
135  }  }

Legend:
Removed from v.1210  
changed lines
  Added in v.1211

  ViewVC Help
Powered by ViewVC 1.1.26