X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FEngine%2FCGI.pm;h=5a090642f223599b87c007df4e702a37303674bc;hp=ae5a65283f069c0e5ab9a8e7d25c2009d4865ef7;hb=0fc2d522eec43202c21e9f0062e43f10db4d9008;hpb=8e061fef6ed2e38808032cbb722098c5c183ec03 diff --git a/lib/Catalyst/Engine/CGI.pm b/lib/Catalyst/Engine/CGI.pm index ae5a652..5a09064 100644 --- a/lib/Catalyst/Engine/CGI.pm +++ b/lib/Catalyst/Engine/CGI.pm @@ -1,10 +1,13 @@ package Catalyst::Engine::CGI; +use Class::C3; use Moose; extends 'Catalyst::Engine'; has env => (is => 'rw'); +no Moose; + =head1 NAME Catalyst::Engine::CGI - The CGI Engine @@ -172,15 +175,14 @@ sub prepare_path { =cut -around prepare_query_parameters => sub { - my $orig = shift; +sub prepare_query_parameters { my ( $self, $c ) = @_; local (*ENV) = $self->env || \%ENV; if ( $ENV{QUERY_STRING} ) { - $self->$orig( $c, $ENV{QUERY_STRING} ); + $self->next::method( $c, $ENV{QUERY_STRING} ); } -}; +} =head2 $self->prepare_request($c, (env => \%env)) @@ -200,9 +202,10 @@ Enable autoflush on the output handle for CGI-based engines. =cut -before prepare_write => sub { +sub prepare_write { *STDOUT->autoflush(1); -}; + return shift->next::method(@_); +} =head2 $self->write($c, $buffer) @@ -210,8 +213,7 @@ Writes the buffer to the client. =cut -around write => sub { - my $orig = shift; +sub write { my ( $self, $c, $buffer ) = @_; # Prepend the headers if they have not yet been sent @@ -219,8 +221,8 @@ around write => sub { $buffer = $headers . $buffer; } - return $self->$orig( $c, $buffer ); -}; + return $self->next::method( $c, $buffer ); +} =head2 $self->read_chunk($c, $buffer, $length)