Workaround for ModPerl/Mouse bug (#1452)

This commit is contained in:
Xavier Guimard 2018-06-13 23:10:40 +02:00
parent 213f674b9e
commit f4b3e43a2c
3 changed files with 29 additions and 3 deletions

View File

@ -2,7 +2,6 @@ package Lemonldap::NG::Common::Logger::Log4perl;
use strict;
use Log::Log4perl;
use Mouse;
our $VERSION = '2.0.0';

View File

@ -8,8 +8,21 @@ package Lemonldap::NG::Common::Session;
our $VERSION = '2.0.0';
use Mouse;
use Lemonldap::NG::Common::Apache::Session;
BEGIN {
require Mouse;
my $v = $Mouse::VERSION;
$v =~ s/^v//;
if ( $v =~ /^2\.(?:1|2|3|4)/
and $INC{'Lemonldap/NG/Handler/Apache2/Main.pm'} )
{
require Moose;
Moose->import();
}
else {
Mouse->import();
}
}
has 'id' => (
is => 'rw',

View File

@ -4,7 +4,21 @@ use strict;
use Safe;
use Lemonldap::NG::Common::Safelib; #link protected safe Safe object
use Mouse;
BEGIN {
require Mouse;
my $v = $Mouse::VERSION;
$v =~ s/^v//;
if ( $v =~ /^2\.(?:1|2|3|4)/
and $INC{'Lemonldap/NG/Handler/Apache2/Main.pm'} )
{
require Moose;
Moose->import();
}
else {
Mouse->import();
}
}
has customFunctions => ( is => 'rw', isa => 'Maybe[Str]' );