Added recursive -r flag to prove example
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / Apache.pm
index a683631..2e0f374 100644 (file)
@@ -1,12 +1,24 @@
 package Catalyst::Engine::Apache;
 
 use strict;
-use base 'Catalyst::Engine';
 
-use URI;
-use URI::http;
+# 1.27     MP13
+# 1.28     MP13
+# 1.29     MP13
+# 1.2901   MP13
+# 1.30     MP13 TBR
 
-__PACKAGE__->mk_accessors(qw/apache/);
+# 1.9901   MP19
+# 1.9920   MP19
+# 1.999020 MP19 RC3
+# 1.999021 MP19 RC4
+
+# 1.999022 MP20 RC5
+# 1.999023 MP20 RC6
+
+1;
+
+__END__
 
 =head1 NAME
 
@@ -18,105 +30,7 @@ See L<Catalyst>.
 
 =head1 DESCRIPTION
 
-This is the Catalyst engine specialized for Apache (i.e. for mod_perl).
-
-=head1 METHODS
-
-=over 4
-
-=item $c->apache
-
-Returns an C<Apache::Request> object.
-
-=back
-
-=head1 OVERLOADED METHODS
-
-This class overloads some methods from C<Catalyst::Engine>.
-
-=over 4
-
-=item $c->finalize_output
-
-=cut
-
-sub finalize_output {
-    my $c = shift;
-    $c->apache->print( $c->response->output );
-}
-
-=item $c->prepare_connection
-
-=cut
-
-sub prepare_connection {
-    my $c = shift;
-    $c->request->hostname( $c->apache->connection->remote_host );
-    $c->request->address( $c->apache->connection->remote_ip );
-}
-
-=item $c->prepare_headers
-
-=cut
-
-sub prepare_headers {
-    my $c = shift;
-    $c->request->method( $c->apache->method );
-    $c->request->header( %{ $c->apache->headers_in } );
-}
-
-=item $c->prepare_parameters
-
-=cut
-
-sub prepare_parameters {
-    my $c = shift;
-
-    foreach my $key ( $c->apache->param ) {
-        my @values = $c->apache->param($key);
-        $c->req->parameters->{$key} = ( @values == 1 ) ? $values[0] : \@values;
-    }
-}
-
-=item $c->prepare_path
-
-=cut
-
-# XXX needs fixing, only work with <Location> directive,
-# not <Directory> directive
-sub prepare_path {
-    my $c = shift;
-    $c->request->path( $c->apache->uri );
-    my $loc = $c->apache->location;
-    no warnings 'uninitialized';
-    $c->req->{path} =~ s/^($loc)?\///;
-    my $base = URI->new;
-    $base->scheme( $ENV{HTTPS} ? 'https' : 'http' );
-    $base->host( $c->apache->hostname );
-    $base->port( $c->apache->get_server_port );
-    my $path = $c->apache->location;
-    $base->path( $path =~ /\/$/ ? $path : "$path/" );
-    $c->request->base( $base->as_string );
-}
-
-=item $c->prepare_request($r)
-
-=cut
-
-sub prepare_request {
-    my ( $c, $r ) = @_;
-    $c->apache( $ENV{MOD_PERL_API_VERSION} == 2
-        ? Apache2::Request->new($r)
-        : Apache::Request->new($r) );
-}
-
-=item $c->run
-
-=cut
-
-sub run { }
-
-=back
+This class will load the correct MP Engine.
 
 =head1 SEE ALSO
 
@@ -125,6 +39,7 @@ L<Catalyst>.
 =head1 AUTHOR
 
 Sebastian Riedel, C<sri@cpan.org>
+Christian Hansen C<ch@ngmedia.com>
 
 =head1 COPYRIGHT
 
@@ -132,5 +47,3 @@ This program is free software, you can redistribute it and/or modify it under
 the same terms as Perl itself.
 
 =cut
-
-1;