X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fbin%2Fmason_handler.fcgi;h=881d6388a9b226ea679c565751d5703cafb2b77b;hb=10cddd917072b9d148b30c7561db34b0133695f4;hp=38f590124aaa072c1e4990295a9b450b7a91e676;hpb=c648976f0b7975f2328ebd7ba8c711fad0ca4195;p=freeside.git diff --git a/rt/bin/mason_handler.fcgi b/rt/bin/mason_handler.fcgi index 38f590124..881d6388a 100755 --- a/rt/bin/mason_handler.fcgi +++ b/rt/bin/mason_handler.fcgi @@ -2,8 +2,8 @@ # BEGIN BPS TAGGED BLOCK {{{ # # COPYRIGHT: -# -# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +# +# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -46,18 +46,16 @@ # those contributions and any derivatives thereof. # # END BPS TAGGED BLOCK }}} -package RT::Mason; - use strict; -use vars '$Handler'; +use warnings; +no warnings qw(once); + use File::Basename; -require ('/opt/rt3/bin/webmux.pl'); +require (dirname(__FILE__) .'/webmux.pl'); # Enter CGI::Fast mode, which should also work as a vanilla CGI script. require CGI::Fast; -RT::Init(); - while ( my $cgi = CGI::Fast->new ) { # the whole point of fastcgi requires the env to get reset here.. # So we must squash it again @@ -67,15 +65,19 @@ while ( my $cgi = CGI::Fast->new ) { $ENV{'ENV'} = '' if defined $ENV{'ENV'}; $ENV{'IFS'} = '' if defined $ENV{'IFS'}; - Module::Refresh->refresh if $RT::DevelMode; + 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($@); }