C. Chad Wallace wrote:
Hello,

Has anyone yet used CGI::Application under mod_perl 2.0 (without the Apache::compat layer)?

I think some others have patched their versions to work with mp2, but full compatibility is still in the works.


I just got it to work, after a bit of work... All I had to do, aside from changes to my own modules, was edit CGI::Application::Plugin::Apache. Now that Apache::Request is available for mod_perl 2.0, it's no longer a nightmare! :-)

Exactly


I've attached a patch to CAP::Apache version 0.09 that includes my changes, based on "A Reference to mod_perl 1.0 to mod_perl 2.0 Migration"[1]. Here is a summary of my changes, with the relevant sections of that document, for any of you who are interested:


* Changed "use Apache" to "use mod_perl" (not sure if this part is essential, but it's what I've seen used most in the docs) and "use Apache::Constants" to "use Apache::Const" (Migration Reference, sec. 1.6). I also changed the import of Apache::Const to import only the two constants that are used by CAP::Apache.

In _send_headers() sub:
* Changed "REDIRECT" to "HTTP_MOVED_TEMPORARILY" (sec. 1.6.2).
* If there are no headers, call "$q->content_type" instead of "$q->send_http_header" (sec. 1.15.19)


In _handle_cgi_header_props() sub:
* Changed all "$q->header_out()" calls to "$q->headers_out->{...}" (sec. 1.15.14)
* Removed use of $_ in a foreach loop.
* Removed calls to "$q->send_http_header()" (sec. 1.15.19).



Any suggestions or comments? Oh, one caveat: with these changes, I don't think the module will still work under mod_perl 1.0, since I'm not concerned about that any more. It might not be too hard to edit the module so it will work with both, but that is left as an exercise for the reader. ;-)

Yeah, these changes won't let it work under mp1. My goal is to get it to work under both. I'll look at your changes and incorporate where necessary. I know I keep saying that mp2 support will be coming soon, but I keep getting a little swamped with projects at work. It won't be long though I promise :)


Thanks for the feedback and help.

--
Michael Peters
Developer
Plus Three, LP


--------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/cgiapp@lists.erlbaum.net/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to