[freeside-commits] freeside/rt/bin mason_handler.fcgi, 1.5, 1.6 mason_handler.scgi, 1.5, 1.6

Ivan,,, ivan at wavetail.420.am
Tue May 18 12:20:30 PDT 2010


Update of /home/cvs/cvsroot/freeside/rt/bin
In directory wavetail.420.am:/tmp/cvs-serv2904/bin

Modified Files:
	mason_handler.fcgi mason_handler.scgi 
Log Message:
merging rt \3.8.8 to HEAD

Index: mason_handler.scgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/rt/bin/mason_handler.scgi,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -d -r1.5 -r1.6
--- mason_handler.scgi	31 Dec 2009 13:59:58 -0000	1.5
+++ mason_handler.scgi	18 May 2010 19:20:28 -0000	1.6
@@ -56,18 +56,13 @@
 
 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;

Index: mason_handler.fcgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/rt/bin/mason_handler.fcgi,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -d -r1.5 -r1.6
--- mason_handler.fcgi	31 Dec 2009 13:59:58 -0000	1.5
+++ mason_handler.fcgi	18 May 2010 19:20:28 -0000	1.6
@@ -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);
 
+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 @@
     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($@);
     }



More information about the freeside-commits mailing list