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
=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))
=cut
-before prepare_write => sub {
+sub prepare_write {
*STDOUT->autoflush(1);
-};
+ return shift->next::method(@_);
+}
=head2 $self->write($c, $buffer)
=cut
-around write => sub {
- my $orig = shift;
+sub write {
my ( $self, $c, $buffer ) = @_;
# Prepend the headers if they have not yet been sent
$buffer = $headers . $buffer;
}
- return $self->$orig( $c, $buffer );
-};
+ return $self->next::method( $c, $buffer );
+}
=head2 $self->read_chunk($c, $buffer, $length)