/[webpac2]/Webpacus/lib/Webpacus/Model/WebPAC.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 /Webpacus/lib/Webpacus/Model/WebPAC.pm

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

revision 222 by dpavlin, Mon Dec 5 19:15:01 2005 UTC revision 224 by dpavlin, Mon Dec 5 19:15:11 2005 UTC
# Line 90  sub new { Line 90  sub new {
90          $self->{db} = new WebPAC::Store(          $self->{db} = new WebPAC::Store(
91                  path => $db_path,                  path => $db_path,
92                  read_only => 1,                  read_only => 1,
93                    database => $est_cfg->{database},
94          );          );
95    
96          $self->{out} = new WebPAC::Output::TT(          $self->{out} = new WebPAC::Output::TT(
# Line 191  sub search { Line 192  sub search {
192    
193          for my $i ( 0 .. $#results ) {          for my $i ( 0 .. $#results ) {
194    
195                  my $mfn = $1 if ( $results[$i]->{'@uri'} =~ m#/(\d+)$#);                  my ($id, $prefix);
196                    if ( $results[$i]->{'@uri'} =~ m!/([^/]+)#(\d+)$!) {
197                            ($prefix,$id) = ($1,$2);
198                    } else {
199                            $log->warn("can't decode prefix#id from " .  $results[$i]->{'@uri'});
200                            next;
201                    }
202    
203                  #$log->debug("load_ds( $mfn )");                  #$log->debug("load_ds( id => $id, prefix => '$prefix' )");
204    
205                  $t = time();                  $t = time();
206    
207                  my $ds = $self->{db}->load_ds( $mfn ) || $log->error("can't load_ds( $mfn )") && next;                  my $ds = $self->{db}->load_ds( id => $id, prefix => $prefix ) || $log->error("can't load_ds( id => $id, prefix => '$prefix' )") && next;
208    
209                  $times->{db} += time() - $t;                  $times->{db} += time() - $t;
210    
# Line 251  sub record { Line 258  sub record {
258          my $log = $self->{log};          my $log = $self->{log};
259          $log->debug("args: " . Dumper( $args ));          $log->debug("args: " . Dumper( $args ));
260    
261          foreach my $f (qw/mfn template/) {          foreach my $f (qw/mfn template prefix/) {
262                  $log->die("need $f") unless ($args->{$f});                  $log->die("need $f") unless ($args->{$f});
263          }          }
264    
265          my $mfn = $args->{mfn};          my $mfn = $args->{mfn};
266    
267          my $ds = $self->{db}->load_ds( $mfn ) || $log->error("can't load_ds( $mfn )") && next;          my $ds = $self->{db}->load_ds( id => $mfn, prefix => 'FIXME' ) || $log->error("can't load_ds( $mfn )") && next;
268    
269          my $html = $self->{out}->apply(          my $html = $self->{out}->apply(
270                  template => $args->{template},                  template => $args->{template},

Legend:
Removed from v.222  
changed lines
  Added in v.224

  ViewVC Help
Powered by ViewVC 1.1.26