X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fbin%2Fmason_handler.fcgi;h=0439a3b061e2a2303a60e700486cf3023b807f1b;hp=4fe888a933f32ff56a1e42fd0a2c48d9b94fba71;hb=e70abd21bab68b23488f7ef1ee2e693a3b365691;hpb=b4b0c7e72d7eaee2fbfc7022022c9698323203dd diff --git a/rt/bin/mason_handler.fcgi b/rt/bin/mason_handler.fcgi index 4fe888a93..0439a3b06 100755 --- a/rt/bin/mason_handler.fcgi +++ b/rt/bin/mason_handler.fcgi @@ -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($@); }