From fbcb7de93884b7915ea17906d112e1e8cb0dd490 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 30 May 2016 01:57:52 +0000 Subject: www: remove a few more Plack::Request dependencies Still a work in progress, but SearchView no longer depends on Plack::Request at all and Feed is getting there. We now parse all query parameters up front, but we may do that lazily again in the future. --- lib/PublicInbox/SearchView.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/PublicInbox/SearchView.pm') diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index 0ae05052..2ec7ddf8 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -16,7 +16,7 @@ our $LIM = 50; sub sres_top_html { my ($ctx) = @_; - my $q = PublicInbox::SearchQuery->new($ctx->{cgi}); + my $q = PublicInbox::SearchQuery->new($ctx->{qp}); my $code = 200; # double the limit for expanded views: @@ -260,13 +260,13 @@ use warnings; use PublicInbox::Hval; sub new { - my ($class, $cgi) = @_; - my $r = $cgi->param('r'); - my ($off) = (($cgi->param('o') || '0') =~ /(\d+)/); + my ($class, $qp) = @_; + + my $r = $qp->{r}; bless { - q => $cgi->param('q'), - x => $cgi->param('x') || '', - o => $off, + q => $qp->{'q'}, + x => $qp->{x} || '', + o => (($qp->{o} || '0') =~ /(\d+)/), r => (defined $r && $r ne '0'), }, $class; } -- cgit v1.2.3-24-ge0c7