Move conf backends (#595)

This commit is contained in:
Xavier Guimard 2017-01-06 12:30:41 +00:00
parent c52bddd9ef
commit 118beaa022
11 changed files with 20 additions and 20 deletions

View File

@ -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 ($@) {

View File

@ -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 ) = @_;

View File

@ -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 ) = @_;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -1,4 +1,4 @@
package Lemonldap::NG::Common::Conf::MongoDB;
package Lemonldap::NG::Common::Conf::Backends::MongoDB;
use 5.010;
use utf8;

View File

@ -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 ) = @_;

View File

@ -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;
}
}

View File

@ -1,4 +1,4 @@
package Lemonldap::NG::Common::Conf::_DBI;
package Lemonldap::NG::Common::Conf::Backends::_DBI;
use strict;
use utf8;

View File

@ -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'
);