use FS::Mason qw( mason_interps );
use FS::Trace;
+if ( %%%RT_ENABLED%%% ) {
+
+ require RT;
+
+ $> = scalar(getpwnam('freeside'));
+
+ RT::LoadConfig();
+ RT::Init();
+
+ # disconnect DB before fork:
+ # (avoid 'prepared statement "dbdpg_p\d+_\d+" already exists' errors?)
+ $RT::Handle->dbh(undef);
+ undef $RT::Handle;
+
+ $> = $<;
+}
+
#use vars qw($r);
# Bring in ApacheHandler, necessary for mod_perl integration.
return -1 if defined( $r->content_type )
&& $r->content_type !~ m!(^text/|\bxml\b)!io;
-
local $SIG{__WARN__};
local $SIG{__DIE__};
FS::Trace->log('done');
- FS::Trace->dumpfile("%%%FREESIDE_EXPORT%%%/profile/$$.".time, $r->filename)
+ FS::Trace->dumpfile( "%%%FREESIDE_EXPORT%%%/profile/$$.".time,
+ FS::Trace->total. ' '. $r->filename
+ )
if FS::Trace->total > 5; #10?
FS::Trace->reset;
$status;
}
-my $rt_initialized = 0;
-
sub my_rt_init {
return unless $RT::VERSION;
-
- if ( $rt_initialized ) {
- RT::ConnectToDatabase();
- RT::InitSignalHandlers();
- } else {
- RT::LoadConfig();
- RT::Init();
- $rt_initialized++;
- }
+ RT::ConnectToDatabase();
+ RT::InitSignalHandlers();
}
1;