diff options
Diffstat (limited to 'rt/bin/mason_handler.fcgi.in')
-rw-r--r-- | rt/bin/mason_handler.fcgi.in | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/rt/bin/mason_handler.fcgi.in b/rt/bin/mason_handler.fcgi.in index 48155f257..baf407d94 100644 --- a/rt/bin/mason_handler.fcgi.in +++ b/rt/bin/mason_handler.fcgi.in @@ -46,23 +46,16 @@ # those contributions and any derivatives thereof. # # END BPS TAGGED BLOCK }}} -package RT::Mason; - use strict; -use vars '$Handler'; -use File::Basename; +use warnings; +no warnings qw(once); -require (dirname(__FILE__) . '/webmux.pl'); +use File::Basename; +require (dirname(__FILE__) .'/webmux.pl'); # Enter CGI::Fast mode, which should also work as a vanilla CGI script. require CGI::Fast; -RT::Init(); -$Handler ||= RT::Interface::Web::Handler->new( - RT->Config->Get('MasonParameters') -); - - while ( my $cgi = CGI::Fast->new ) { # the whole point of fastcgi requires the env to get reset here.. # So we must squash it again @@ -75,12 +68,16 @@ while ( my $cgi = CGI::Fast->new ) { Module::Refresh->refresh if RT->Config->Get('DevelMode'); RT::ConnectToDatabase(); - if ( ( !$Handler->interp->comp_exists( $cgi->path_info ) ) - && ( $Handler->interp->comp_exists( $cgi->path_info . "/index.html" ) ) ) { + my $interp = $RT::Mason::Handler->interp; + if ( + !$interp->comp_exists( $cgi->path_info ) + && $interp->comp_exists( $cgi->path_info . "/index.html" ) + ) { $cgi->path_info( $cgi->path_info . "/index.html" ); } - eval { $Handler->handle_cgi_object($cgi); }; + local $@; + eval { $RT::Mason::Handler->handle_cgi_object($cgi); }; if ($@) { $RT::Logger->crit($@); } |