/[webpac]/trunk2/lib/WebPAC/Index.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 /trunk2/lib/WebPAC/Index.pm

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

trunk2/index_DBI_cache.pm revision 337 by dpavlin, Thu Jun 10 19:22:40 2004 UTC trunk2/lib/WebPac/Index.pm revision 348 by dpavlin, Sun Jun 13 20:20:29 2004 UTC
# Line 6  Line 6 
6  # library). But, that functionality is not used anyway...  # library). But, that functionality is not used anyway...
7  #  #
8    
9  package index_DBI;  package WebPac::Index;
10  use strict qw(vars);  use strict qw(vars);
11  use vars qw($Count);  use vars qw($Count);
12  use HTML::Entities;  use HTML::Entities;
13  use URI::Escape;  use URI::Escape;
14  use locale;  use locale;
15    use Carp;
16    
17  use DBI;  use DBI;
18    
# Line 36  sub bench { Line 37  sub bench {
37    
38  sub new {  sub new {
39          my $class = shift;          my $class = shift;
40          my $self = {};          my $self = {@_};
41          bless($self, $class);          bless($self, $class);
42    
43          my $dbd = shift || die "need dbi_dbd= in [global] section of configuration file";          croak "need dbd" if (! $self->{dbd});
44          my $dsn = shift || die "need dbi_dsn= in [global] section of configuration file";          croak "need dsn" if (! $self->{dsn});
45          my $user = shift || die "need dbi_user= in [global] section of configuration file";          croak "need user" if (! $self->{user});
46          my $passwd = shift || die "need dbi_passwd= in [global] section of configuration file";          croak "need passwd" if (! $self->{passwd});
47    
48          $self->{dbd} = $dbd;          $self->{dbh} = DBI->connect("DBI:$self->{dbd}:$self->{dsn}",$self->{user},$self->{passwd}) || die $DBI::errstr;
   
         $self->{dbh} = DBI->connect("DBI:$dbd:$dsn",$user,$passwd) || die $DBI::errstr;  
49          $Count++;          $Count++;
50    
51          $self->bench("connected to $dbd as $user");          $self->bench("connected to $self->{dbd} as $self->{user}");
52    
53          # force SQLite to support binary 0 in data (which shouldn't          # force SQLite to support binary 0 in data (which shouldn't
54          # happend, but it did to me)          # happend, but it did to me)

Legend:
Removed from v.337  
changed lines
  Added in v.348

  ViewVC Help
Powered by ViewVC 1.1.26