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=2fcc8f8c4de955bf158c447ef6853eb4a2b57973;hp=d04fea49ecace01f6d13033df65351423b1f1c97;hb=4090e3bb3fea1a73ac369250e31584d61428b808;hpb=6f1f968a6bc42bf4a4b50a1ee22d3aaecd801876 diff --git a/lib/Catalyst/Engine/CGI.pm b/lib/Catalyst/Engine/CGI.pm index d04fea4..2fcc8f8 100644 --- a/lib/Catalyst/Engine/CGI.pm +++ b/lib/Catalyst/Engine/CGI.pm @@ -1,14 +1,10 @@ package Catalyst::Engine::CGI; -use MRO::Compat; -use mro 'c3'; use Moose; extends 'Catalyst::Engine'; has env => (is => 'rw'); -no Moose; - =head1 NAME Catalyst::Engine::CGI - The CGI Engine @@ -176,14 +172,15 @@ sub prepare_path { =cut -sub prepare_query_parameters { +around prepare_query_parameters => sub { + my $orig = shift; my ( $self, $c ) = @_; local (*ENV) = $self->env || \%ENV; if ( $ENV{QUERY_STRING} ) { - $self->next::method( $c, $ENV{QUERY_STRING} ); + $self->$orig( $c, $ENV{QUERY_STRING} ); } -} +}; =head2 $self->prepare_request($c, (env => \%env)) @@ -203,10 +200,10 @@ Enable autoflush on the output handle for CGI-based engines. =cut -sub prepare_write { +around prepare_write => sub { *STDOUT->autoflush(1); - return shift->next::method(@_); -} + return shift->(@_); +}; =head2 $self->write($c, $buffer) @@ -214,7 +211,8 @@ Writes the buffer to the client. =cut -sub write { +around write => sub { + my $orig = shift; my ( $self, $c, $buffer ) = @_; # Prepend the headers if they have not yet been sent @@ -222,8 +220,8 @@ sub write { $buffer = $headers . $buffer; } - return $self->next::method( $c, $buffer ); -} + return $self->$orig( $c, $buffer ); +}; =head2 $self->read_chunk($c, $buffer, $length) @@ -255,5 +253,6 @@ This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. =cut +no Moose; 1;