X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Flib%2FRT.pm;h=7e941a2b2359078d0c25a7b33c06a7b17df38fe1;hp=90c332bc0f97e9385f059094d00a20176703c218;hb=289340780927b5bac2c7604d7317c3063c6dd8cc;hpb=945721f48f74d5cfffef7c7cf3a3d6bc2521f5dd diff --git a/rt/lib/RT.pm b/rt/lib/RT.pm index 90c332bc0..7e941a2b2 100644 --- a/rt/lib/RT.pm +++ b/rt/lib/RT.pm @@ -47,7 +47,7 @@ use vars qw($VERSION $System $SystemUser $Nobody $Handle $Logger $MasonSessionDir ); -$VERSION = '3.0.4'; +$VERSION = '3.0.9'; $CORE_CONFIG_FILE = "/opt/rt3/etc/RT_Config.pm"; $SITE_CONFIG_FILE = "/opt/rt3/etc/RT_SiteConfig.pm"; @@ -117,13 +117,10 @@ sub LoadConfig { =cut sub Init { - require RT::Handle; + #Get a database connection - unless ($Handle && $Handle->dbh->ping) { - $Handle = RT::Handle->new(); - } - $Handle->Connect(); - + ConnectToDatabase(); + #RT's system user is a genuine database user. its id lives here $SystemUser = new RT::CurrentUser(); $SystemUser->LoadByName('RT_System'); @@ -137,6 +134,21 @@ sub Init { InitLogging(); } + +=head2 ConnectToDatabase + +Get a database connection + +=cut + +sub ConnectToDatabase { + require RT::Handle; + unless ($Handle && $Handle->dbh && $Handle->dbh->ping) { + $Handle = RT::Handle->new(); + } + $Handle->Connect(); +} + =head2 InitLogging Create the RT::Logger object. @@ -282,8 +294,15 @@ sub DropSetGIDPermissions { =head1 BUGS +Please report them to rt-3.0-bugs@fsck.com, if you know what's broken and have at least some idea of what needs to be fixed. +If you're not sure what's going on, report them rt-devel@lists.fsck.com. + =head1 SEE ALSO +L +L + + =begin testing