- Improved: Params handling with MP engines
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / Apache / MP19.pm
index c068100..8ced4e8 100644 (file)
@@ -27,7 +27,7 @@ See L<Catalyst>.
 
 =head1 DESCRIPTION
 
-This is the Catalyst engine specialized for Apache mod_perl version 2.
+This is the Catalyst engine specialized for Apache mod_perl version 1.9x.
 
 =head1 OVERLOADED METHODS
 
@@ -67,6 +67,15 @@ sub handler : method {
     shift->SUPER::handler(@_);
 }
 
+=item $c->prepare_request($r)
+
+=cut
+
+sub prepare_request {
+    my ( $c, $r ) = @_;
+    $c->apache( Apache::Request->new($r) );
+}
+
 =item $c->prepare_uploads
 
 =cut
@@ -74,9 +83,12 @@ sub handler : method {
 sub prepare_uploads {
     my $c = shift;
 
-    my @uploads;
+    # This is a workaround for a know bug with libapreq <= 2.0.5
+    # http://svn.apache.org/viewcvs.cgi?rev=122925&view=rev
+    
+    my @uploads;    
 
-    for my $field ( $c->apache->upload ) {
+    for my $field ( $c->request->param ) {
 
         for my $upload ( $c->apache->upload($field) ) {
 
@@ -91,7 +103,7 @@ sub prepare_uploads {
         }
     }
 
-    $c->req->_assign_values( $c->req->uploads, \@uploads );
+    $c->request->_assign_values( $c->req->uploads, \@uploads );
 }
 
 =back
@@ -103,6 +115,7 @@ L<Catalyst>, L<Catalyst::Engine>, L<Catalyst::Engine::Apache>.
 =head1 AUTHOR
 
 Sebastian Riedel, C<sri@cpan.org>
+Christian Hansen C<ch@ngmedia.com>
 
 =head1 COPYRIGHT