Move conf backends (#595)

environments/ppa-mbqj77/deployments/1
Xavier Guimard 9 years ago
parent c52bddd9ef
commit 118beaa022
  1. 2
      lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm
  2. 6
      lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/CDBI.pm
  3. 6
      lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/DBI.pm
  4. 2
      lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/File.pm
  5. 4
      lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/JSONFile.pm
  6. 2
      lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/LDAP.pm
  7. 2
      lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/MongoDB.pm
  8. 6
      lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/RDBI.pm
  9. 6
      lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/SOAP.pm
  10. 2
      lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/_DBI.pm
  11. 2
      lemonldap-ng-common/t/01-Common-Conf.t

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

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

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

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

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

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

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

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

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

@ -1,4 +1,4 @@
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'
);

Loading…
Cancel
Save