require CGI::Simple;
require CGI::Cookie;
+$CGI::Simple::POST_MAX = 1048576;
+$CGI::Simple::DISABLE_UPLOADS = 0;
+
__PACKAGE__->mk_accessors('cgi');
=head1 NAME
=head1 SYNOPSIS
+ #!/usr/bin/perl -w
+
+ use strict;
+ use lib '/path/to/MyApp/lib';
+ use MyApp;
+
+ MyApp->run;
+
See L<Catalyst>.
=head1 DESCRIPTION
This is the CGI engine for Catalyst.
+The script shown above must be designated as a "Non-parsed Headers"
+script to function properly.
+To do this in Apache name the script starting with C<nph->.
+
+The performance of this way of using Catalyst is not expected to be
+useful in production applications, but it may be helpful for development.
+
=head2 METHODS
=head3 run
$c->req->{path} =~ s/^($loc)?\///;
$c->req->{path} .= '/' if $c->req->path eq $loc;
my $base = $c->cgi->url;
+ if ( $ENV{CATALYST_TEST} ) {
+ my $script = $c->cgi->script_name;
+ $base =~ s/$script$//i;
+ }
$base = URI->new($base);
$base->path('/') if ( $ENV{CATALYST_TEST} || !$base->path );
$c->req->base( $base->as_string );
sub prepare_uploads {
my $c = shift;
for my $name ( $c->cgi->upload ) {
- my $filename = $c->req->params->{$name};
$c->req->uploads->{$name} = {
- fh => $c->cgi->upload($filename),
- filename => $filename,
- size => $c->cgi->upload_info( $filename, 'size' ),
- type => $c->cgi->upload_info( $filename, 'mime' )
+ fh => $c->cgi->upload($name),
+ size => $c->cgi->upload_info( $name, 'size' ),
+ type => $c->cgi->upload_info( $name, 'mime' )
};
}
}
=cut
1;
-## Please see file perltidy.ERR