From 118beaa022558e092737c7220782768c9a2374bf Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Fri, 6 Jan 2017 12:30:41 +0000 Subject: [PATCH] Move conf backends (#595) --- lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm | 2 +- .../lib/Lemonldap/NG/Common/Conf/{ => Backends}/CDBI.pm | 6 +++--- .../lib/Lemonldap/NG/Common/Conf/{ => Backends}/DBI.pm | 6 +++--- .../lib/Lemonldap/NG/Common/Conf/{ => Backends}/File.pm | 2 +- .../lib/Lemonldap/NG/Common/Conf/{ => Backends}/JSONFile.pm | 4 ++-- .../lib/Lemonldap/NG/Common/Conf/{ => Backends}/LDAP.pm | 2 +- .../lib/Lemonldap/NG/Common/Conf/{ => Backends}/MongoDB.pm | 2 +- .../lib/Lemonldap/NG/Common/Conf/{ => Backends}/RDBI.pm | 6 +++--- .../lib/Lemonldap/NG/Common/Conf/{ => Backends}/SOAP.pm | 6 +++--- .../lib/Lemonldap/NG/Common/Conf/{ => Backends}/_DBI.pm | 2 +- lemonldap-ng-common/t/01-Common-Conf.t | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) rename lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/{ => Backends}/CDBI.pm (89%) rename lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/{ => Backends}/DBI.pm (85%) rename lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/{ => Backends}/File.pm (98%) rename lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/{ => Backends}/JSONFile.pm (56%) rename lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/{ => Backends}/LDAP.pm (99%) rename lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/{ => Backends}/MongoDB.pm (97%) rename lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/{ => Backends}/RDBI.pm (91%) rename lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/{ => Backends}/SOAP.pm (90%) rename lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/{ => Backends}/_DBI.pm (98%) diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm index aa42c198b..44eceed64 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm @@ -79,7 +79,7 @@ sub new { unless ( $self->{type} =~ /^[\w:]+$/ ) { $msg .= "Error: configStorage: type is not well formed.\n"; } - $self->{type} = "Lemonldap::NG::Common::Conf::$self->{type}" + $self->{type} = "Lemonldap::NG::Common::Conf::Backends::$self->{type}" unless $self->{type} =~ /^Lemonldap::/; eval "require $self->{type}"; if ($@) { diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/CDBI.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/CDBI.pm similarity index 89% rename from lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/CDBI.pm rename to lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/CDBI.pm index c191df380..f24836b81 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/CDBI.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/CDBI.pm @@ -1,12 +1,12 @@ -package Lemonldap::NG::Common::Conf::CDBI; +package Lemonldap::NG::Common::Conf::Backends::CDBI; use strict; use utf8; use JSON; -use Lemonldap::NG::Common::Conf::_DBI; +use Lemonldap::NG::Common::Conf::Backends::_DBI; our $VERSION = '2.0.0'; -our @ISA = qw(Lemonldap::NG::Common::Conf::_DBI); +our @ISA = qw(Lemonldap::NG::Common::Conf::Backends::_DBI); sub store { my ( $self, $fields ) = @_; diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DBI.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/DBI.pm similarity index 85% rename from lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DBI.pm rename to lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/DBI.pm index e36d66b93..6240e487a 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DBI.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/DBI.pm @@ -1,12 +1,12 @@ -package Lemonldap::NG::Common::Conf::DBI; +package Lemonldap::NG::Common::Conf::Backends::DBI; use strict; use utf8; use Lemonldap::NG::Common::Conf::Serializer; -use Lemonldap::NG::Common::Conf::_DBI; +use Lemonldap::NG::Common::Conf::Backends::_DBI; our $VERSION = '2.0.0'; -our @ISA = qw(Lemonldap::NG::Common::Conf::_DBI); +our @ISA = qw(Lemonldap::NG::Common::Conf::Backends::_DBI); sub store { my ( $self, $fields ) = @_; diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/File.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/File.pm similarity index 98% rename from lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/File.pm rename to lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/File.pm index 8cb8fc04d..4e5a7de1a 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/File.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/File.pm @@ -1,4 +1,4 @@ -package Lemonldap::NG::Common::Conf::File; +package Lemonldap::NG::Common::Conf::Backends::File; use strict; use Lemonldap::NG::Common::Conf::Constants; #inherits diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/JSONFile.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/JSONFile.pm similarity index 56% rename from lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/JSONFile.pm rename to lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/JSONFile.pm index 1dd2b8fef..18a864894 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/JSONFile.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/JSONFile.pm @@ -1,9 +1,9 @@ # Now, File.pm is a mix of the old File.pm and JSONFile.pm. So this file is # just set for compatibility -package Lemonldap::NG::Common::Conf::JSONFile; +package Lemonldap::NG::Common::Conf::Backends::JSONFile; use Lemonldap::NG::Common::Conf::File; -our @ISA = qw(Lemonldap::NG::Common::Conf::File); +our @ISA = qw(Lemonldap::NG::Common::Conf::Backends::File); 1; diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/LDAP.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/LDAP.pm similarity index 99% rename from lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/LDAP.pm rename to lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/LDAP.pm index 9e90c193c..bec24e2ef 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/LDAP.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/LDAP.pm @@ -3,7 +3,7 @@ ##@class # Implements LDAP backend for Lemonldap::NG -package Lemonldap::NG::Common::Conf::LDAP; +package Lemonldap::NG::Common::Conf::Backends::LDAP; use strict; use utf8; diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/MongoDB.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/MongoDB.pm similarity index 97% rename from lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/MongoDB.pm rename to lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/MongoDB.pm index 4bfd5212f..dda798317 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/MongoDB.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/MongoDB.pm @@ -1,4 +1,4 @@ -package Lemonldap::NG::Common::Conf::MongoDB; +package Lemonldap::NG::Common::Conf::Backends::MongoDB; use 5.010; use utf8; diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/RDBI.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/RDBI.pm similarity index 91% rename from lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/RDBI.pm rename to lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/RDBI.pm index 3ed7a25db..b13fd611c 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/RDBI.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/RDBI.pm @@ -1,12 +1,12 @@ -package Lemonldap::NG::Common::Conf::RDBI; +package Lemonldap::NG::Common::Conf::Backends::RDBI; use strict; use utf8; use Lemonldap::NG::Common::Conf::Serializer; -use Lemonldap::NG::Common::Conf::_DBI; +use Lemonldap::NG::Common::Conf::Backends::_DBI; our $VERSION = '2.0.0'; -our @ISA = qw(Lemonldap::NG::Common::Conf::_DBI); +our @ISA = qw(Lemonldap::NG::Common::Conf::Backends::_DBI); sub store { my ( $self, $fields ) = @_; diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/SOAP.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/SOAP.pm similarity index 90% rename from lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/SOAP.pm rename to lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/SOAP.pm index 750328f1f..146397b46 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/SOAP.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/SOAP.pm @@ -1,4 +1,4 @@ -package Lemonldap::NG::Common::Conf::SOAP; +package Lemonldap::NG::Common::Conf::Backends::SOAP; use strict; use utf8; @@ -14,8 +14,8 @@ BEGIN { *Lemonldap::NG::Common::Conf::_connect = \&_connect; sub SOAP::Transport::HTTP::Client::get_basic_credentials { - return $Lemonldap::NG::Common::Conf::SOAP::username => - $Lemonldap::NG::Common::Conf::SOAP::password; + return $Lemonldap::NG::Common::Conf::Backends::SOAP::username => + $Lemonldap::NG::Common::Conf::Backends::SOAP::password; } } diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/_DBI.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/_DBI.pm similarity index 98% rename from lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/_DBI.pm rename to lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/_DBI.pm index 3d1a96066..3e6aaad35 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/_DBI.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/_DBI.pm @@ -1,4 +1,4 @@ -package Lemonldap::NG::Common::Conf::_DBI; +package Lemonldap::NG::Common::Conf::Backends::_DBI; use strict; use utf8; diff --git a/lemonldap-ng-common/t/01-Common-Conf.t b/lemonldap-ng-common/t/01-Common-Conf.t index 1213b4616..5c3b48f14 100644 --- a/lemonldap-ng-common/t/01-Common-Conf.t +++ b/lemonldap-ng-common/t/01-Common-Conf.t @@ -21,7 +21,7 @@ ok( ( Lemonldap::NG::Common::Conf->new( type => 'bad' ) == 0 and $Lemonldap::NG::Common::Conf::msg =~ - /Error: Unknown package Lemonldap::NG::Common::Conf::bad\.$/ + /Error: Unknown package Lemonldap::NG::Common::Conf::Backends::bad\.$/ ), 'Bad module' );