diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-04-26 12:49:03 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-04-26 12:49:03 +0000 |
commit | 741ff09d3fcdc73149baf215916d82f587db7157 (patch) | |
tree | 8c708a5800b34b990a93e7a8b04734c49fb0922e /lib/CGI | |
parent | 93ad979b4c8e124ba476a6218be4b39482da0579 (diff) | |
download | perl-741ff09d3fcdc73149baf215916d82f587db7157.tar.gz |
Upgrade to CGI.pm 3.08
p4raw-id: //depot/perl@24326
Diffstat (limited to 'lib/CGI')
-rw-r--r-- | lib/CGI/Carp.pm | 17 | ||||
-rw-r--r-- | lib/CGI/Changes | 4 | ||||
-rw-r--r-- | lib/CGI/Cookie.pm | 21 | ||||
-rw-r--r-- | lib/CGI/Pretty.pm | 3 |
4 files changed, 25 insertions, 20 deletions
diff --git a/lib/CGI/Carp.pm b/lib/CGI/Carp.pm index 4c4bc706fc..94033d6581 100644 --- a/lib/CGI/Carp.pm +++ b/lib/CGI/Carp.pm @@ -465,17 +465,20 @@ END ; if ($mod_perl) { - require mod_perl; - if ($mod_perl::VERSION >= 1.99) { + my $r; + if ($ENV{MOD_PERL_API_VERSION}) { $mod_perl = 2; - require Apache::RequestRec; - require Apache::RequestIO; - require Apache::RequestUtil; + require Apache2::RequestRec; + require Apache2::RequestIO; + require Apache2::RequestUtil; require APR::Pool; require ModPerl::Util; - require Apache::Response; + require Apache2::Response; + $r = Apache2::RequestUtil->request; + } + else { + $r = Apache->request; } - my $r = Apache->request; # If bytes have already been sent, then # we print the message out directly. # Otherwise we make a custom error diff --git a/lib/CGI/Changes b/lib/CGI/Changes index 7a6baf802e..9b22a52a49 100644 --- a/lib/CGI/Changes +++ b/lib/CGI/Changes @@ -1,3 +1,7 @@ + Version 3.08 + 1. update support for mod_perl 2.0. versions prior to + mod_perl 1.999_22 (2.0.0-RC5) are no longer supported. + Version 3.07 1. Fixed typo in mod_perl detection. diff --git a/lib/CGI/Cookie.pm b/lib/CGI/Cookie.pm index a900ec0d7f..164b5ecbad 100644 --- a/lib/CGI/Cookie.pm +++ b/lib/CGI/Cookie.pm @@ -23,18 +23,13 @@ use overload '""' => \&as_string, # Turn on special checking for Doug MacEachern's modperl my $MOD_PERL = 0; if (exists $ENV{MOD_PERL}) { - eval "require mod_perl"; - if (defined $mod_perl::VERSION) { - my $float = $mod_perl::VERSION; - $float += 0; - if ($float >= 1.99) { + if ($ENV{MOD_PERL_API_VERSION} == 2) { $MOD_PERL = 2; - require Apache::RequestUtil; - eval "require APR::Table"; # Changing APIs? I hope not. - } else { - $MOD_PERL = 1; - require Apache; - } + require Apache2::RequestUtil; + require APR::Table; + } else { + $MOD_PERL = 1; + require Apache; } } @@ -74,7 +69,9 @@ sub fetch { sub get_raw_cookie { my $r = shift; - $r ||= eval { Apache->request() } if $MOD_PERL; + $r ||= eval { $MOD_PERL == 2 ? + Apache2::RequestUtil->request() : + Apache->request } if $MOD_PERL; if ($r) { $raw_cookie = $r->headers_in->{'Cookie'}; } else { diff --git a/lib/CGI/Pretty.pm b/lib/CGI/Pretty.pm index d824a025e4..2147143e4a 100644 --- a/lib/CGI/Pretty.pm +++ b/lib/CGI/Pretty.pm @@ -148,11 +148,12 @@ sub new { my $this = $class->SUPER::new( @_ ); if ($CGI::MOD_PERL) { - my $r = Apache->request; if ($CGI::MOD_PERL == 1) { + my $r = Apache->request; $r->register_cleanup(\&CGI::Pretty::_reset_globals); } else { + my $r = Apache2::RequestUtil->request; $r->pool->cleanup_register(\&CGI::Pretty::_reset_globals); } } |