summaryrefslogtreecommitdiff
path: root/rt/bin/mason_handler.fcgi
diff options
context:
space:
mode:
Diffstat (limited to 'rt/bin/mason_handler.fcgi')
-rwxr-xr-xrt/bin/mason_handler.fcgi27
1 files changed, 15 insertions, 12 deletions
diff --git a/rt/bin/mason_handler.fcgi b/rt/bin/mason_handler.fcgi
index 0439a3b06..8092455c1 100755
--- a/rt/bin/mason_handler.fcgi
+++ b/rt/bin/mason_handler.fcgi
@@ -25,7 +25,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+# http://www.gnu.org/copyleft/gpl.html.
#
#
# CONTRIBUTION SUBMISSION POLICY:
@@ -46,16 +46,23 @@
# those contributions and any derivatives thereof.
#
# END BPS TAGGED BLOCK }}}
-use strict;
-use warnings;
-no warnings qw(once);
+package RT::Mason;
+use strict;
+use vars '$Handler';
use File::Basename;
-require (dirname(__FILE__) .'/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();
+$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
@@ -68,16 +75,12 @@ while ( my $cgi = CGI::Fast->new ) {
Module::Refresh->refresh if RT->Config->Get('DevelMode');
RT::ConnectToDatabase();
- my $interp = $RT::Mason::Handler->interp;
- if (
- !$interp->comp_exists( $cgi->path_info )
- && $interp->comp_exists( $cgi->path_info . "/index.html" )
- ) {
+ 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" );
}
- local $@;
- eval { $RT::Mason::Handler->handle_cgi_object($cgi); };
+ eval { $Handler->handle_cgi_object($cgi); };
if ($@) {
$RT::Logger->crit($@);
}