view Lib/IMPL/Web/QueryHandler/PathInfoRewrite.pm @ 166:4267a2ac3d46

Added Class::Template, Rewritten SQL::Schema 'use parent' directive instead of 'use base'
author wizard
date Sat, 23 Apr 2011 23:12:06 +0400
parents 47c9877ccacc
children d1676be8afcc
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;