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; charset=utf-8');
48 $r->content_type('text/html; charset=iso-8859-1');
51 my $headers = $r->headers_out;
52 $headers->{'Cache-control'} = 'no-cache';
54 $headers->{'Expires'} = '0';
56 # $r->send_http_header;
58 if ( $r->filename =~ /\/rt\// ) { #RT
60 $ah->interp($rt_interp);
67 # We don't need to handle non-text, non-xml items
68 return -1 if defined( $r->content_type )
69 && $r->content_type !~ m!(^text/|\bxml\b)!io;
76 RT::Init() if $RT::VERSION; #for lack of something else
78 #we don't want the RT error handlers under FS
82 $ah->interp($fs_interp);
88 eval { $status = $ah->handle_request($r); };
91 # $RT::Logger->crit($@);
98 # if ($RT::Handle->TransactionDepth) {
99 # $RT::Handle->ForceRollback;
101 #"Transaction not committed. Usually indicates a software fault. Data loss may have occurred"