# BEGIN BPS TAGGED BLOCK {{{
#
# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+#
+# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC
# <jesse@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# 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.
#
#
# CONTRIBUTION SUBMISSION POLICY:
# 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 ('@RT_BIN_PATH@/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
$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($@);
}