summaryrefslogtreecommitdiff
path: root/rt/bin
diff options
context:
space:
mode:
authorivan <ivan>2010-05-18 19:20:29 +0000
committerivan <ivan>2010-05-18 19:20:29 +0000
commitb102662c11390d9220ef7a935ce847f18ba221fb (patch)
treef3c06005ce9dd362b40c133a098140d34d909c84 /rt/bin
parent624b2d44625f69d71175c3348cae635d580c890b (diff)
merging rt \3.8.8 to HEAD
Diffstat (limited to 'rt/bin')
-rwxr-xr-xrt/bin/mason_handler.fcgi25
-rwxr-xr-xrt/bin/mason_handler.scgi7
2 files changed, 12 insertions, 20 deletions
diff --git a/rt/bin/mason_handler.fcgi b/rt/bin/mason_handler.fcgi
index 8092455c1..881d6388a 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($@);
}
diff --git a/rt/bin/mason_handler.scgi b/rt/bin/mason_handler.scgi
index 105086681..1a497de77 100755
--- a/rt/bin/mason_handler.scgi
+++ b/rt/bin/mason_handler.scgi
@@ -56,18 +56,13 @@ require (dirname(__FILE__) . '/webmux.pl');
require CGI;
-RT::Init();
-$Handler ||= RT::Interface::Web::Handler->new(
- RT->Config->Get('MasonParameters')
-);
-
-
my $cgi = CGI->new;
if ( ( !$Handler->interp->comp_exists( $cgi->path_info ) )
&& ( $Handler->interp->comp_exists( $cgi->path_info . "/index.html" ) ) ) {
$cgi->path_info( $cgi->path_info . "/index.html" );
}
+RT::ConnectToDatabase();
$Handler->handle_cgi_object($cgi);
RT::Interface::Web::Handler->CleanupRequest();
1;