[Rt-commit] r7215 - rt/branches/3.7-EXPERIMENTAL-TUNIS/lib

ruz at bestpractical.com ruz at bestpractical.com
Mon Mar 12 09:15:55 EDT 2007


Author: ruz
Date: Mon Mar 12 09:15:54 2007
New Revision: 7215

Modified:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT.pm.in

Log:
* add InitSystemObjects

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT.pm.in
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT.pm.in	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT.pm.in	Mon Mar 12 09:15:54 2007
@@ -50,7 +50,7 @@
 
 use File::Spec ();
 
-use vars qw($VERSION $Config $System $SystemUser $Nobody $Handle $Logger);
+use vars qw($Config $System $SystemUser $Nobody $Handle $Logger);
 
 our $VERSION = '@RT_VERSION_MAJOR at .@RT_VERSION_MINOR at .@RT_VERSION_PATCH@';
 
@@ -93,6 +93,8 @@
 
 =head1 DESCRIPTION
 
+=head2 METHODS
+
 =head2 LoadConfig
 
 Load RT's config file.  First, the site configuration file
@@ -133,22 +135,8 @@
 =cut
 
 sub Init {
-
-    #Get a database connection
     ConnectToDatabase();
-
-    #RT's system user is a genuine database user. its id lives here
-    require RT::CurrentUser;
-    $SystemUser = new RT::CurrentUser();
-    $SystemUser->LoadByName('RT_System');
-    
-    #RT's "nobody user" is a genuine database user. its ID lives here.
-    $Nobody = new RT::CurrentUser();
-    $Nobody->LoadByName('Nobody');
-
-    require RT::System;
-    $System = RT::System->new();
-
+    InitSystemObjects;
     InitClasses();
     InitLogging(); 
 }
@@ -370,6 +358,28 @@
 
 # }}}
 
+=head2 InitSystemObjects
+
+Initializes system objects: C<$RT::System>, C<$RT::SystemUser>
+and C<$RT::Nobody>.
+
+=cut
+
+sub InitSystemObjects {
+
+    #RT's system user is a genuine database user. its id lives here
+    require RT::CurrentUser;
+    $SystemUser = new RT::CurrentUser;
+    $SystemUser->LoadByName('RT_System');
+
+    #RT's "nobody user" is a genuine database user. its ID lives here.
+    $Nobody = new RT::CurrentUser;
+    $Nobody->LoadByName('Nobody');
+
+    require RT::System;
+    $System = new RT::System;
+}
+
 
 sub SystemUser {
     return($SystemUser);


More information about the Rt-commit mailing list