On Oct 22, 2004, at 1:16 PM, William McKee wrote:
Looking at the implementation of header_add, header_props and header_type (which are wrappers for CGI.pm header), I can see where it could be a potential headache to reimplement using A::Request.
At risk of sticking my foot in my mouth -- I'm admittedly not very knowledgeable with mod_perl, but from the code I've received that can run under either it did seem that difficult.
I wonder how MT is handling this situation; perhaps we can steal some code from them.
I think I can help here then though I should mention that MT is copyrighted that steal code is , well... call it what you like. Studying the code for ideas is a slightly different thing! That said...
MT implements its header functions in a different way then C::A. He are a few code blocks for the mod_perl parts.
$app->{apache} holds the stashed Apache::Registry object.Sending the http header is like:
if ($ENV{MOD_PERL}) {
if ($app->{response_message}) {
$app->{apache}->status_line(($app->response_code || 200) . " "
. $app->{response_message});
} else {
$app->{apache}->status($app->response_code || 200);
}
$app->{apache}->send_http_header($type);
}Getting a header is
if ($ENV{MOD_PERL}) {
return $app->{apache}->header_in($key);
}Setting a header:
if ($ENV{MOD_PERL}) {
$app->{apache}->header_out($key, $val);
}The accompanying "else" in each of these use the standard CGI means and ENV variables for implementing that mode of the header functionality. There are more spots through out the MT::App module (the equivalent of C::A) code wrapped in the if-$ENV{MOD_PERL}-else if you want to download a copy and take a look. (There is no cost for limited personal use and development work. See their site for more details. http://www.movabletype.org/)
<tim/>
--------------------------------------------------------------------- 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]
