Mercurial > pub > Impl
annotate Lib/IMPL/Web/QueryHandler/PathInfoRewrite.pm @ 194:4d0e1962161c
Replaced tabs with spaces
IMPL::Web::View - fixed document model, new features (control classes, document constructor parameters)
author | cin |
---|---|
date | Tue, 10 Apr 2012 20:08:29 +0400 |
parents | d1676be8afcc |
children |
rev | line source |
---|---|
161
47c9877ccacc
Added a handler for rewriting a PATH_INFO value, useful with a json handlers
wizard
parents:
diff
changeset
|
1 package IMPL::Web::QueryHandler::PathInfoRewrite; |
47c9877ccacc
Added a handler for rewriting a PATH_INFO value, useful with a json handlers
wizard
parents:
diff
changeset
|
2 use strict; |
47c9877ccacc
Added a handler for rewriting a PATH_INFO value, useful with a json handlers
wizard
parents:
diff
changeset
|
3 |
166 | 4 use parent qw(IMPL::Web::QueryHandler); |
161
47c9877ccacc
Added a handler for rewriting a PATH_INFO value, useful with a json handlers
wizard
parents:
diff
changeset
|
5 __PACKAGE__->PassThroughArgs; |
47c9877ccacc
Added a handler for rewriting a PATH_INFO value, useful with a json handlers
wizard
parents:
diff
changeset
|
6 |
47c9877ccacc
Added a handler for rewriting a PATH_INFO value, useful with a json handlers
wizard
parents:
diff
changeset
|
7 use IMPL::Class::Property; |
47c9877ccacc
Added a handler for rewriting a PATH_INFO value, useful with a json handlers
wizard
parents:
diff
changeset
|
8 |
47c9877ccacc
Added a handler for rewriting a PATH_INFO value, useful with a json handlers
wizard
parents:
diff
changeset
|
9 BEGIN { |
194 | 10 public property pathinfoPrefix => prop_all; |
161
47c9877ccacc
Added a handler for rewriting a PATH_INFO value, useful with a json handlers
wizard
parents:
diff
changeset
|
11 } |
47c9877ccacc
Added a handler for rewriting a PATH_INFO value, useful with a json handlers
wizard
parents:
diff
changeset
|
12 |
47c9877ccacc
Added a handler for rewriting a PATH_INFO value, useful with a json handlers
wizard
parents:
diff
changeset
|
13 sub Process { |
194 | 14 my ($this,$query,$nextHandler) = @_; |
15 | |
16 my $pathInfo = $ENV{PATH_INFO}; | |
17 if (my $rx = $this->pathinfoPrefix) { | |
18 $pathInfo =~ s/^($rx)//; | |
19 } | |
20 | |
21 local $ENV{PATH_INFO} = $pathInfo; | |
22 | |
23 scalar $nextHandler->(); | |
161
47c9877ccacc
Added a handler for rewriting a PATH_INFO value, useful with a json handlers
wizard
parents:
diff
changeset
|
24 } |
47c9877ccacc
Added a handler for rewriting a PATH_INFO value, useful with a json handlers
wizard
parents:
diff
changeset
|
25 |
180 | 26 1; |