The uploaded file
CGI-Application-Plugin-Apache-0.10.tar.gz
has entered CPAN as
file: $CPAN/authors/id/W/WO/WONKO/CGI-Application-Plugin-Apache-0.10.tar.gz
size: 11699 bytes
md5: a84f239b99e919ab1c17c5fbc131593f
Changes in this release include:
- Added CGI::Application::Plugin::Apache::Request wrapper around
Apache::Request for some CGI.pm compatability
- full mod_perl 2 compatability
- Added more tests
NAME CGI::Application::Plugin::Apache - Allow CGI::Application to use Apache::* modules without interference
SYNOPSIS
use base âCGI::Applicationâ;
use CGI::Application::Plugin::Apache qw(:all); # then later we join our hero in a run mode...
sub mode1 {
my $self = shift;
my $q = $self->query(); # $q is an Apache::Request # do some stuff
# now we can bake a cookie using Apache::Cookie
# without interference
$cookie = Apache::Cookie->new(
$q,
-name => âfooâ,
-value => âbarâ,
-expires => â+2hâ,
);
$cookie->bake; # now letâs play with the content_type and other headers
$q->content_type(âtext/plainâ);
$q->header_out(âMyHeaderâ => âMyValueâ); # do other stuff
return $content;
} 1;
DESCRIPTION
This plugin helps to try and fix some of the annoyances of
using CGI::Application in a pure mod_perl (1.0 or 2.0) envi-
ronment. CGI::Application assumes that you use CGI.pm, but I
wanted to avoid itâs bloat and have access to the performance
of the Apache::* modules so along came this plugin. At the
current moment it only does two things: Use Apache::Request as the "$self->query" object thus avoiding
the creation of the CGI.pm object.
Override the way CGI::Application creates and prints itâs HTTP
headers. Since it was using CGI.pmâs "header()" and "redi-
rect()" methodâs we needed an alternative. So now we use the
"Apache->send_http_header()" method. This has a few additional
benefits other than just not using CGI.pm. It means that we
can use other Apache::* modules that might also create outgo-
ing headers (e.g. Apache::Cookie) without CGI::Application
clobbering them.
-- Michael Peters Developer Plus Three, LP
--------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/[email protected]/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
