Commit 118beaa0 authored by Yadd's avatar Yadd
Browse files

Move conf backends (#595)

parent c52bddd9
......@@ -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 ($@) {
......
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 ) = @_;
......
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 ) = @_;
......
package Lemonldap::NG::Common::Conf::File;
package Lemonldap::NG::Common::Conf::Backends::File;
use strict;
use Lemonldap::NG::Common::Conf::Constants; #inherits
......
# 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;
......@@ -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;
......
package Lemonldap::NG::Common::Conf::MongoDB;
package Lemonldap::NG::Common::Conf::Backends::MongoDB;
use 5.010;
use utf8;
......
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 ) = @_;
......
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;
}
}
......
package Lemonldap::NG::Common::Conf::_DBI;
package Lemonldap::NG::Common::Conf::Backends::_DBI;
use strict;
use utf8;
......
......@@ -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'
);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment