summaryrefslogtreecommitdiff
path: root/rt/bin/mason_handler.fcgi
diff options
context:
space:
mode:
authorivan <ivan>2010-05-18 18:49:59 +0000
committerivan <ivan>2010-05-18 18:49:59 +0000
commite70abd21bab68b23488f7ef1ee2e693a3b365691 (patch)
tree75986ffa9ba6ab4f961f9033468a1344e1653408 /rt/bin/mason_handler.fcgi
parentb4b0c7e72d7eaee2fbfc7022022c9698323203dd (diff)
import rt 3.8.8
Diffstat (limited to 'rt/bin/mason_handler.fcgi')
-rwxr-xr-xrt/bin/mason_handler.fcgi25
1 files changed, 11 insertions, 14 deletions
diff --git a/rt/bin/mason_handler.fcgi b/rt/bin/mason_handler.fcgi
index 4fe888a..0439a3b 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($@);
}