[Rt-commit] r14980 - rt/3.8/trunk/lib/RT

ruz at bestpractical.com ruz at bestpractical.com
Sun Aug 10 08:34:05 EDT 2008


Author: ruz
Date: Sun Aug 10 08:34:04 2008
New Revision: 14980

Modified:
   rt/3.8/trunk/lib/RT/Config.pm

Log:
* as Plugins are in config then we should load main config first
  and then we can get list of plugins' configs

Modified: rt/3.8/trunk/lib/RT/Config.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Config.pm	(original)
+++ rt/3.8/trunk/lib/RT/Config.pm	Sun Aug 10 08:34:04 2008
@@ -462,26 +462,26 @@
 
 =head2 Configs
 
-Returns list of the top level configs file names. F<RT_Config.pm> is always
-first, other configs are ordered by name.
+Returns list of config files found in local etc, plugins' etc
+and main etc directories.
 
 =cut
 
 sub Configs {
     my $self    = shift;
+
     my @configs = ();
-    foreach my $path ( $RT::LocalEtcPath, $RT::EtcPath ) {
+    foreach my $path ( $RT::LocalEtcPath, RT->PluginDirs('etc'), $RT::EtcPath ) {
         my $mask = File::Spec->catfile( $path, "*_Config.pm" );
         my @files = glob $mask;
         @files = grep !/^RT_Config\.pm$/,
             grep $_ && /^\w+_Config\.pm$/,
             map { s/^.*[\\\/]//; $_ } @files;
-        push @configs, @files;
+        push @configs, sort @files;
     }
 
-    @configs = sort @configs;
-    unshift( @configs, 'RT_Config.pm' );
-
+    my %seen;
+    @configs = grep !$seen{$_}++, @configs;
     return @configs;
 }
 


More information about the Rt-commit mailing list