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 # We don't need to handle non-text, non-xml items
61 return -1 if defined( $r->content_type )
62 && $r->content_type !~ m!(^text/|\bxml\b)!io;
70 $ah->interp($rt_interp);
77 RT::Init() if $RT::VERSION; #for lack of something else
79 #we don't want the RT error handlers under FS
81 no warnings 'uninitialized';
82 undef($SIG{__WARN__}) if defined($SIG{__WARN__});
83 undef($SIG{__DIE__}) if defined($SIG{__DIE__} );
86 $ah->interp($fs_interp);
92 eval { $status = $ah->handle_request($r); };
95 # $RT::Logger->crit($@);
102 # if ($RT::Handle->TransactionDepth) {
103 # $RT::Handle->ForceRollback;
105 #"Transaction not committed. Usually indicates a software fault. Data loss may have occurred"