/[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 304 by dpavlin, Sun Dec 18 23:35:24 2005 UTC revision 305 by dpavlin, Tue Dec 20 00:00:57 2005 UTC
# Line 40  Configuration for hyperestraier in C<con Line 40  Configuration for hyperestraier in C<con
40    user: 'admin'    user: 'admin'
41    passwd: 'admin'    passwd: 'admin'
42    hits_on_page: 100    hits_on_page: 100
43      hits_for_pager: 1000
44    
45   webpac:   webpac:
46    db_path: '/data/webpac2/db'    db_path: '/data/webpac2/db'
# Line 113  sub new { Line 114  sub new {
114                  "'"                  "'"
115          );          );
116    
117            $self->{databases} = $c->config->{databases} || $log->error("can't find databases in config");
118    
119          return $self;          return $self;
120    
# Line 156  sub search { Line 158  sub search {
158    
159          my $template_filename = $args->{template} || $self->{template};          my $template_filename = $args->{template} || $self->{template};
160    
161          $args->{max} ||= $self->{'hits_on_page'};          $args->{max} ||= $self->{'hits_for_pager'};
162          if (! $args->{max}) {          if (! $args->{max}) {
163                  $args->{max} = 10;                  $args->{max} = 100;
164                  $log->warn("max not set when calling model. Using default of 10");                  $log->warn("max not set when calling model. Using default of $args->{max}");
165          }          }
166    
167          my $times;      # store some times for benchmarking          my $times;      # store some times for benchmarking
# Line 220  sub search { Line 222  sub search {
222                          template => $template_filename,                          template => $template_filename,
223                          data => $ds,                          data => $ds,
224                          record_uri => "${database}/${prefix}/${id}",                          record_uri => "${database}/${prefix}/${id}",
225                            config => $self->{databases}->{$database},
226                  );                  );
227    
228                  $times->{out} += time() - $t;                  $times->{out} += time() - $t;
# Line 286  sub record { Line 289  sub record {
289                  template => $args->{template},                  template => $args->{template},
290                  data => $ds,                  data => $ds,
291                  record_uri => $args->{record_uri},                  record_uri => $args->{record_uri},
292                    config => $self->{databases}->{$database},
293          );          );
294    
295          $html = $self->{iconv}->convert( $html ) || $log->error("can't convert: $html");          $html = $self->{iconv}->convert( $html ) || $log->error("can't convert: $html");
# Line 293  sub record { Line 297  sub record {
297          return $html;          return $html;
298  }  }
299    
300    
301  =head2 save_html  =head2 save_html
302    
303    $m->save_html( '/full/path/to/file', $content );    $m->save_html( '/full/path/to/file', $content );

Legend:
Removed from v.304  
changed lines
  Added in v.305

  ViewVC Help
Powered by ViewVC 1.1.26