stas 2004/03/22 18:34:19
Modified: lib/Apache Status.pm . Changes Log: Fix Apache::Status, to gracefully recover from failing to load Apache::Request when mp1's version is found. Previously it was affecting Apache::compat Revision Changes Path 1.22 +21 -3 modperl-2.0/lib/Apache/Status.pm Index: Status.pm =================================================================== RCS file: /home/cvs/modperl-2.0/lib/Apache/Status.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -u -u -r1.21 -r1.22 --- Status.pm 23 Mar 2004 00:13:44 -0000 1.21 +++ Status.pm 23 Mar 2004 02:34:19 -0000 1.22 @@ -31,10 +31,28 @@ our $newQ; -if (eval {require Apache::Request}) { - $newQ ||= sub { Apache::Request->new(@_) }; +if (eval { require Apache::Request }) { + if ($Apache::Request::VERSION >= 2) { + $newQ ||= sub { Apache::Request->new(@_) }; + } } -elsif (eval {require CGI}) { +else { + if ($@ !~ m|^Can't locate Apache/Request.pm|) { + # we hit Apache::Request from mp1 which has failed to load + # because it couldn't load other things, but it left all kind + # of things behind, that will affect other code (e.g. magical + # Apache::Table in %INC), so try to undo the damage + # otherwise loading Apache::compat which calls: + # $INC{'Apache/Table.pm'} = __FILE__; + # crashes + delete $INC{"Apache/Table.pm"}; + delete $INC{"Apache/Request.pm"}; + } + else { + # user has no Apache::Request installed + } +} +if (!$newQ && eval { require CGI }) { if ($CGI::VERSION >= 2.93) { $newQ ||= sub { CGI->new(@_) }; } 1.350 +4 -0 modperl-2.0/Changes Index: Changes =================================================================== RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.349 retrieving revision 1.350 diff -u -u -r1.349 -r1.350 --- Changes 18 Mar 2004 22:53:31 -0000 1.349 +++ Changes 23 Mar 2004 02:34:19 -0000 1.350 @@ -12,6 +12,10 @@ =item 1.99_14-dev +Fix Apache::Status, to gracefully recover from failing to load +Apache::Request when mp1's version is found. Previously it was +affecting Apache::compat [Stas] + Fix a bug in special blocks handling (like END), which until now was dropping on the floor all blocks but the last one (mainly affecting registry handlers). [Stas]