This file documents the revision history for Perl extension Catalyst.
- - Support optional hashref as last param for parameters in uri_for.
- - Updated tutorial to be more complete.
+5.65 2006-02-21 10:34:00
+ - Added plugin introspection.
+ - Support optional hashref as last param for parameters in uri_for.
+ - Updated tutorial to be more complete.
+ - Applied args patch from antirice (Fixes Ticket #67)
5.64 2006-02-07 20:29:00
- Fixed bug in FastCGI proc manager mode where pm_post_dispatch
# If not, move the last part path to args
unshift @args, pop @path;
}
+ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg for @args;
$c->log->debug( 'Path is "' . $c->req->match . '"' )
if ( $c->debug && $c->req->match );
--- /dev/null
+package TestApp::Controller::Args;
+
+use strict;
+use base 'Catalyst::Base';
+use Data::Dumper;
+
+sub args :Local {
+ my ( $self, $c ) = @_;
+ $c->res->body( join('',@{$c->req->args}) );
+}
+
+sub params :Local {
+ my ( $self, $c ) = splice @_, 0, 2;
+ $c->res->body( join('',@_) );
+}
+
+1;
\ No newline at end of file
--- /dev/null
+#!perl
+
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use URI::Escape;
+
+our @paths;
+our $iters;
+
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2;
+
+ # add special paths to test here
+ @paths = (
+ # all reserved in uri's
+ qw~ : / ? [ ] @ ! $ & ' ( ) * + ; = ~, ',' , '#',
+
+ # unreserved
+ 'a'..'z','A'..'Z',0..9,qw( - . _ ~ ),
+ " ",
+
+ # just to test %2F/%
+ [ qw~ / / ~ ],
+
+ # testing %25/%25
+ [ qw~ % % ~ ],
+ );
+}
+
+use Test::More tests => 4*@paths * $iters;
+use Catalyst::Test 'TestApp';
+
+if ( $ENV{CAT_BENCHMARK} ) {
+ require Benchmark;
+ Benchmark::timethis( $iters, \&run_tests );
+
+ # new dispatcher:
+ # 11 wallclock secs (10.14 usr + 0.20 sys = 10.34 CPU) @ 15.18/s (n=157)
+ # old dispatcher (r1486):
+ # 11 wallclock secs (10.34 usr + 0.20 sys = 10.54 CPU) @ 13.76/s (n=145)
+}
+else {
+ for ( 1 .. $iters ) {
+ run_tests();
+ }
+}
+
+sub run_tests {
+ run_test_for($_) for @paths;
+}
+
+sub run_test_for {
+ my $test = shift;
+
+ my $path;
+ if (ref $test) {
+ $path = join "/", map uri_escape($_), @$test;
+ $test = join '', @$test;
+ } else {
+ $path = uri_escape($test);
+ }
+
+ my $response;
+
+ ok( $response = request("http://localhost/args/args/$path"), "Requested args for path $path");
+
+ is( $response->content, $test, 'as args' );
+
+ undef $response;
+
+ ok( $response = request("http://localhost/args/params/$path"), "Requested params for path $path");
+
+ is( $response->content, $test, 'as params' );
+}
+