From 3082b9adb43931ca090157d416345460866f3e48 Mon Sep 17 00:00:00 2001
From: Guillaume Rousse <guillaume.rousse@renater.fr>
Date: Tue, 31 Oct 2017 17:44:55 +0100
Subject: [PATCH] load Conf module where needed only

---
 bin/account-manager-client.pl                | 1 +
 bin/account-manager-web.pl                   | 1 +
 lib/IdPAccountManager/AuthenticationToken.pm | 2 --
 lib/IdPAccountManager/SAMLMetadata.pm        | 1 -
 lib/IdPAccountManager/Tools.pm               | 1 +
 lib/IdPAccountManager/WebRequest.pm          | 1 +
 6 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/bin/account-manager-client.pl b/bin/account-manager-client.pl
index 6f34d79..52f3942 100755
--- a/bin/account-manager-client.pl
+++ b/bin/account-manager-client.pl
@@ -15,6 +15,7 @@ use lib qw(lib conf);
 use Getopt::Long qw(:config auto_help);
 use Pod::Usage;
 
+use Conf;
 use IdPAccountManager::TestAccount;
 use IdPAccountManager::SAMLMetadata;
 use IdPAccountManager::ServiceProvider;
diff --git a/bin/account-manager-web.pl b/bin/account-manager-web.pl
index 57cadd9..a6e37d4 100755
--- a/bin/account-manager-web.pl
+++ b/bin/account-manager-web.pl
@@ -18,6 +18,7 @@ use CGI::Util;
 use Template;
 use Template::Constants qw( :debug );
 
+use Conf;
 use IdPAccountManager::TestAccount;
 use IdPAccountManager::SAMLMetadata;
 use IdPAccountManager::ServiceProvider;
diff --git a/lib/IdPAccountManager/AuthenticationToken.pm b/lib/IdPAccountManager/AuthenticationToken.pm
index 992cbda..7660661 100644
--- a/lib/IdPAccountManager/AuthenticationToken.pm
+++ b/lib/IdPAccountManager/AuthenticationToken.pm
@@ -10,8 +10,6 @@ use warnings;
 use IdPAccountManager::Data::AuthenticationToken;
 use IdPAccountManager::Data::AuthenticationToken::Manager;
 
-use Conf;
-
 use Digest::MD5;
 use POSIX qw(strftime);
 
diff --git a/lib/IdPAccountManager/SAMLMetadata.pm b/lib/IdPAccountManager/SAMLMetadata.pm
index 1cbfdad..909e222 100644
--- a/lib/IdPAccountManager/SAMLMetadata.pm
+++ b/lib/IdPAccountManager/SAMLMetadata.pm
@@ -9,7 +9,6 @@ use warnings;
 
 use IdPAccountManager::Tools;
 use IdPAccountManager::Logger;
-use Conf;
 
 use XML::LibXML;
 
diff --git a/lib/IdPAccountManager/Tools.pm b/lib/IdPAccountManager/Tools.pm
index c5c20b7..477ed34 100644
--- a/lib/IdPAccountManager/Tools.pm
+++ b/lib/IdPAccountManager/Tools.pm
@@ -4,6 +4,7 @@ package IdPAccountManager::Tools;
 ## This software was developed by RENATER. The research leading to these results has received funding
 ## from the European Community¹s Seventh Framework Programme (FP7/2007-2013) under grant agreement nº 238875 (GÉANT).
 
+use Conf;
 use Template;
 
 # load Template::Stash to make method tables visible
diff --git a/lib/IdPAccountManager/WebRequest.pm b/lib/IdPAccountManager/WebRequest.pm
index 21a8396..e6f41f0 100755
--- a/lib/IdPAccountManager/WebRequest.pm
+++ b/lib/IdPAccountManager/WebRequest.pm
@@ -4,6 +4,7 @@ use strict;
 use warnings;
 
 use IdPAccountManager::Logger;
+use Conf;
 
 ## New web request
 sub new {
-- 
GitLab