lemonldap-ng/lemonldap-ng-common/lib/Lemonldap/NG/Common/Module.pm

24 lines
529 B
Perl
Raw Normal View History

2016-06-02 23:20:36 +02:00
package Lemonldap::NG::Common::Module;
2016-03-29 23:09:55 +02:00
use strict;
use Mouse;
2019-02-12 18:21:38 +01:00
our $VERSION = '2.1.0';
2016-03-29 23:09:55 +02:00
2017-02-15 07:41:50 +01:00
# Object that provides loggers and error methods (typically PSGI object)
2016-12-26 10:23:35 +01:00
has p => ( is => 'rw', weak_ref => 1 );
2016-06-02 23:20:36 +02:00
# Lemonldap::NG configuration hash ref
2016-03-29 23:09:55 +02:00
has conf => ( is => 'rw', weak_ref => 1 );
2018-11-16 17:30:57 +01:00
has logger => ( is => 'rw', lazy => 1, default => sub { $_[0]->{p}->logger } );
has userLogger =>
( is => 'rw', lazy => 1, default => sub { $_[0]->{p}->userLogger } );
2016-03-29 23:09:55 +02:00
sub error {
my $self = shift;
return $self->p->error(@_);
}
1;