view Lib/IMPL/Web/QueryHandler/PathInfoRewrite.pm @ 204:d63f9a92d6d4

+IMPL::Config::Include - simple way to include external config *IMPL::Web::Handler::TTView - finished template selecting mechanism (not tested)
author sergey
date Wed, 02 May 2012 17:42:47 +0400
parents 4d0e1962161c
children
line wrap: on
line source

package IMPL::Web::QueryHandler::PathInfoRewrite;
use strict;

use parent qw(IMPL::Web::QueryHandler);
__PACKAGE__->PassThroughArgs;

use IMPL::Class::Property;

BEGIN {
    public property pathinfoPrefix => prop_all;
}

sub Process {
    my ($this,$query,$nextHandler) = @_;
    
    my $pathInfo = $ENV{PATH_INFO};
    if (my $rx = $this->pathinfoPrefix) {
        $pathInfo =~ s/^($rx)//;
    }
    
    local $ENV{PATH_INFO} = $pathInfo;
    
    scalar $nextHandler->();
}

1;