[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cgiapp] [ANNOUNCE] CGI::Application::Plugin::Apache 0.10


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/suppressed/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.