7 use FS::Mason qw( mason_interps );
11 # Bring in ApacheHandler, necessary for mod_perl integration.
12 # Uncomment the second line (and comment the first) to use
13 # Apache::Request instead of CGI.pm to parse arguments.
14 use HTML::Mason::ApacheHandler;
15 # use HTML::Mason::ApacheHandler (args_method=>'mod_perl');
17 ###use Module::Refresh;###
19 # Create Mason objects
21 my( $fs_interp, $rt_interp ) = mason_interps('apache');
23 my $ah = new HTML::Mason::ApacheHandler (
25 request_class => 'FS::Mason::Request',
26 args_method => 'CGI', #(and FS too)
29 # Activate the following if running httpd as root (the normal case).
30 # Resets ownership of all files created by Mason at startup.
32 #chown (Apache->server->uid, Apache->server->gid, $interp->files_written);
39 # If you plan to intermix images in the same directory as
40 # components, activate the following to prevent Mason from
41 # evaluating image files as components.
43 #return -1 if $r->content_type && $r->content_type !~ m|^text/|i;
45 ###Module::Refresh->refresh;###
47 $r->content_type('text/html');
50 my $headers = $r->headers_out;
51 $headers->{'Cache-control'} = 'no-cache';
53 $headers->{'Expires'} = '0';
55 # $r->send_http_header;
57 if ( $r->filename =~ /\/rt\// ) { #RT
59 $ah->interp($rt_interp);
66 # We don't need to handle non-text, non-xml items
67 return -1 if defined( $r->content_type )
68 && $r->content_type !~ m!(^text/|\bxml\b)!io;
72 $ah->interp($fs_interp);
78 eval { $status = $ah->handle_request($r); };
81 # $RT::Logger->crit($@);
88 # if ($RT::Handle->TransactionDepth) {
89 # $RT::Handle->ForceRollback;
91 #"Transaction not committed. Usually indicates a software fault. Data loss may have occurred"