James Abbott wrote: > Hi Michael, > > Thanks for the response. I've sorted the problem with the headers now. I > think these which mainly occurred due to the app having evolved from CGI > -> MP1 -> MP2, and has been hacked on each transition until it worked, > but with some unnecessary detritus being left behind (including a > combination of CGI/CA and MP method calls on the query object).
Sounds like a good time :) > Having looked further into the code, CAP::Apache itself seems fine, with > all the necessary Apache -> Apache2 differences all handled within > version specific conditional blocks. but the problems I hit were in > CAP::Apache::Request, which still has all the modules are in the > 'Apache' namespace. Ahh! I knew I had given CAP::Apache some mod_perl2 lovin', but I guess I missed other things in the distro. Thanks for tracking those down. > The cases where these are 'use'd can be handled by a > 'require xxx; import xxx';' in a conditional block as in CAP::Apache, > but I think the big problem is with the subclassing, since 'use base' > does not appear amenable to such treatment. That can be modified in a BEGIN block... > I saw in the list archives that you do not want to have separate modules > for MP1/MP2, but I suspect to some extent that is inevitable here. The > cleanest way I can think of is to create separate (but minimalist...) > CAPA::Request and CAPA2::Request classes which inherit from > Apache::Request and Apache2::Request respectively, then create a > separate subclass containing the rest of the code which can require and > import the appropriate CAPA(2?)::Request module according to the flavour > of mod_perl being used. The MP1/MP2 specific code could then either be > split into the appropriate classes (probably cleaner...), or just left > in the generic subclass with conditional statements as it is at present > if you prefer keeping it together. This would also need a hack to the > CAPA use the correct class for the query object if CAPA_CGI_Compat is > enabled. > > I can have a go at coding this up if you don't think it's too wacky or > there is something horribly wrong with my logic.... I think having 2 separate CAP::Apache plugins is a bad thing because it would mean people have to change their code when they upgrade to Apache2. But I wouldn't mind have 2 CAP::Apache::Request classes since they are more behind the scenes workers and aren't really used directly. If you want to take a crack at implementing that, I'm sure I could find some time to apply the patches and make a release. -- 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]
