How do I include sub-config files in Config.pm

Moderator: crythias

Locked
Nicsoft
Znuny newbie
Posts: 53
Joined: 12 Aug 2010, 14:58
Znuny Version: 2.4
Location: Stockholm
Contact:

How do I include sub-config files in Config.pm

Post by Nicsoft »

Hello,

For the sake of easyness of administration when a lot of configuration is needed in the Config.pm, I would like to create a directury structure in which I can have configuration files for different customers or groups.

How do I include or reference those from the Config.pm file in order for the content in the sub file to be recognized?

Below is some files and their content. The error_log is not complaining that the file is missing, so in some way the file is at least found.

Config.pm:

Code: Select all

    
 package Kernel::Config;
    
   sub Load {
    
    #other activities
    
    require 'customer_config.pm';
    
    #other activities

    }
    1;
customer_config.pm (file to be refenced from Config.pm)

Code: Select all

    # Filter Queues
    
    $Self->{TicketAcl}->{'ACL-hide-queues'} = {
                    Properties => {
    },
                    PossibleNot => {Ticket => { Queue =>
                        ['[RegExp]^*'] },
    
      },
    };
    1;
How do I solve this? I have never worked with Perl/CGI before.

Thanks in advance!
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How do I include sub-config files in Config.pm

Post by crythias »

:qI believe you could use "use" in Config.pm

Code: Select all

use Kernel::YourPackage;
where your config is YourPackage.pm

Code: Select all

package Kernel::YourPackage;
... Your results may vary.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Locked