[Rt-commit] r4811 - in rt/branches/3.7-EXPERIMENTAL: . sbin

alexmv at bestpractical.com alexmv at bestpractical.com
Thu Mar 23 18:30:04 EST 2006


Author: alexmv
Date: Thu Mar 23 18:30:04 2006
New Revision: 4811

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Config.pm
   rt/branches/3.7-EXPERIMENTAL/sbin/rt-setup-database.in

Log:
 r11823 at zoq-fot-pik:  chmrr | 2006-03-23 18:29:51 -0500
  * Backwards compatibility for Configuration
  * Support for running arbitrary code after everything else has been loaded


Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Config.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Config.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Config.pm	Thu Mar 23 18:30:04 2006
@@ -301,13 +301,17 @@
     my $type = $META{$name}->{'Type'} || 'SCALAR';
     if( $type eq 'ARRAY' ) {
         $OPTIONS{$name} = [ @_ ];
+        { no strict 'refs';  @{"RT::$name"} = (@_); }
     } elsif( $type eq 'HASH' ) {
         $OPTIONS{$name} = { @_ };
+        { no strict 'refs';  %{"RT::$name"} = (@_); }
     } else {
         $OPTIONS{$name} = shift;
+        { no strict 'refs';  ${"RT::$name"} = $OPTIONS{$name}; }
     }
     $META{$name}->{'Type'} = $type;
 
+
     return 1;
 }
 

Modified: rt/branches/3.7-EXPERIMENTAL/sbin/rt-setup-database.in
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/sbin/rt-setup-database.in	(original)
+++ rt/branches/3.7-EXPERIMENTAL/sbin/rt-setup-database.in	Thu Mar 23 18:30:04 2006
@@ -47,7 +47,7 @@
 use strict;
 use vars qw($PROMPT $VERSION $Handle $Nobody $SystemUser $item);
 use vars
-  qw(@Groups @Users @ACL @Queues @ScripActions @ScripConditions @Templates @CustomFields @Scrips @Attributes);
+  qw(@Groups @Users @ACL @Queues @ScripActions @ScripConditions @Templates @CustomFields @Scrips @Attributes @Final);
 
 use lib ("@LOCAL_LIB_PATH@", "@RT_LIB_PATH@");
 
@@ -638,6 +638,14 @@
         }
         print "done.\n";
     }
+
+    if (@Final) {
+        print "Running final actions...\n";
+        for (@Final) {
+            eval { $_->(); };
+            print "(Error: $@)\n" if $@;
+        }
+    }
     $RT::Handle->Disconnect() unless ($db_type eq 'SQLite');
     print "Done setting up database content.\n";
 }


More information about the Rt-commit mailing list