Cees Hek wrote:
On Thu, 21 Oct 2004 14:15:37 -0400, Michael <[EMAIL PROTECTED]> wrote:

Rob Kinyon wrote:

Also, and I know this may be more trouble than it's worth, but it
might be useful to write a C::A::Plugin::Apache2 so that both AP1 and
AP2 can be supported easily. I'm not sure if there's an environment
variable or some other test that could be used to see if the module is
being pulled into a mp1 or mp2 environment. If that were the case,
then the C::A::P::Apache should probably delegate to C::A::P::Apache1
vs. C::A::P::Apache2, if possible.

Not more trouble then it's worth, but maybe more than I can do right now. :) I'll need to get a mod_perl2 setup going before I can really do any targeted development for it. And yes there is an environment var that most of the modules look at when trying to do both. I'll probably just keep it in the same module and alter it's behavior accordingly.


Hi Michael,

If you are already checking to see which version of mod_perl is
running, then I think it would probably also be useful to detect if
mod_perl is NOT available!  If it is not, maybe your plugin can
gracefully get out of the way, and let the application work with the
standard CGI.pm module.  I think you can just look at $ENV{MOD_PERL}
for whether mod_perl is running, and what version is being used.

I actually haven't started on the mod_perl version support (it just supports mod_perl 1) since I don't have a working mod_perl 2 installation just yet. Give me some time though (or if someone else wants to help out :)


At first I didn't like this suggestion since I think you should know what environment you're in. I you're developing an app for both environments then I think you should just develop it as a normal cgi and then use something like Apache::Registry or Apache::PerlRun. My initial target audience was developers who use CGI::App in an all mod_perl environment and don't want to mess with any old CGI style code.

But the more I think about the more I don't dis-like the idea. It doesn't do any harm to those who want to use it as is. My main concern with it is that if the developers think that it will run the same in a both mod_perl and mod_cgi then they are mistaken. For instance, if they used my plugin while developing under vanilla CGI then they would have access to all of CGI.pm's methods (html generation, etc). If they then switched to mod_perl (even under Apache::Registry) then it would all break.

Maybe I need to think about this more and hear other's ideas before I implement it.

This would allow app developers to put the C::A::P::Apache plugin in
all their apps, and use it in a CGI and mod_perl environment without
any code changes.

-- 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]



Reply via email to