1 package Catalyst::Engine::Apache::MP20;
4 use base 'Catalyst::Engine::Apache';
6 use Apache2::Connection ();
8 use Apache2::RequestIO ();
9 use Apache2::RequestRec ();
10 use Apache2::RequestUtil ();
11 use Apache2::Request ();
12 use Apache2::Cookie ();
13 use Apache2::Upload ();
17 Apache2::Const->import( -compile => ':common' );
21 Catalyst::Engine::Apache::MP20 - Catalyst Apache MP20 Engine
29 This is the Catalyst engine specialized for Apache mod_perl version 2.0.
31 =head1 OVERLOADED METHODS
33 This class overloads some methods from C<Catalyst::Engine::Apache>.
37 =item $c->finalize_headers
41 sub finalize_headers {
44 for my $name ( $c->response->headers->header_field_names ) {
45 next if $name =~ /Content-Type/i;
46 my @values = $c->response->header($name);
47 $c->apache->headers_out->add( $name => $_ ) for @values;
50 if ( $c->response->header('Set-Cookie') && $c->response->status >= 300 ) {
51 my @values = $c->response->header('Set-Cookie');
52 $c->apache->err_headers_out->add( 'Set-Cookie' => $_ ) for @values;
55 $c->apache->status( $c->response->status );
56 $c->apache->content_type( $c->response->header('Content-Type') );
65 sub handler : method {
66 shift->SUPER::handler(@_);
69 =item $c->prepare_request($r)
75 $c->apache( Apache2::Request->new($r) );
78 =item $c->prepare_uploads
87 for my $field ( $c->apache->upload ) {
89 for my $upload ( $c->apache->upload($field) ) {
91 my $object = Catalyst::Request::Upload->new(
92 filename => $upload->filename,
93 size => $upload->size,
94 tempname => $upload->tempname,
98 push( @uploads, $field, $object );
102 $c->req->_assign_values( $c->req->uploads, \@uploads );
109 L<Catalyst>, L<Catalyst::Engine>, L<Catalyst::Engine::Apache>.
113 Sebastian Riedel, C<sri@cpan.org>
114 Christian Hansen C<ch@ngmedia.com>
118 This program is free software, you can redistribute it and/or modify it under
119 the same terms as Perl itself.