Revert "Fix part of circular links (related to #1990)"

This reverts commit c9e7f3a1b0.
This commit is contained in:
Xavier Guimard 2020-04-23 12:00:11 +02:00
parent 31f05b9e2d
commit 0baf014e6b
5 changed files with 11 additions and 31 deletions

View File

@ -1,7 +1,6 @@
package Lemonldap::NG::Common::Logger::_Duplicate;
use strict;
use Scalar::Util 'weaken';
our $VERSION = '2.0.6';
@ -12,7 +11,6 @@ sub new {
die $@ if ($@);
$self->{logger} = $args{logger}->new(@_);
$self->{dup} = $args{dup} or die 'Missing dup';
weaken($self->{dup});
return $self;
}

View File

@ -11,18 +11,9 @@ has p => ( is => 'rw', weak_ref => 1 );
# Lemonldap::NG configuration hash ref
has conf => ( is => 'rw', weak_ref => 1 );
has logger => (
is => 'rw',
lazy => 1,
weak_ref => 1,
default => sub { $_[0]->{p}->logger }
);
has userLogger => (
is => 'rw',
lazy => 1,
weak_ref => 1,
default => sub { $_[0]->{p}->userLogger }
);
has logger => ( is => 'rw', lazy => 1, default => sub { $_[0]->{p}->logger } );
has userLogger =>
( is => 'rw', lazy => 1, default => sub { $_[0]->{p}->userLogger } );
sub error {
my $self = shift;

View File

@ -3,7 +3,6 @@ package Lemonldap::NG::Common::PSGI::Router;
use Mouse;
use Lemonldap::NG::Common::PSGI;
use Lemonldap::NG::Common::PSGI::Constants;
use Scalar::Util 'weaken';
our $VERSION = '2.0.8';
@ -94,7 +93,6 @@ sub genRoute {
}
}
elsif ( $self->can($dest) ) {
weaken($self);
$routes->{$word} = sub { shift; $self->$dest(@_) };
}
else {

View File

@ -19,8 +19,8 @@ our @_onReload;
sub onReload {
my ( $class, $obj, $sub ) = @_;
weaken($obj);
push @_onReload, [ $obj, $sub ];
weaken($_onReload[$#_onReload]->[0]);
}
# CONFIGURATION UPDATE

View File

@ -15,7 +15,6 @@ package Lemonldap::NG::Portal::Main;
use strict;
use Mouse;
use Regexp::Assemble;
use Scalar::Util 'weaken';
# PROPERTIES
@ -93,16 +92,13 @@ has cors => ( is => 'rw' );
sub init {
my ( $self, $args ) = @_;
$args ||= {};
$self->localConfig( {} );
{
my $h = Lemonldap::NG::Common::Conf->new( $args->{configStorage} )
->getLocalConf('portal');
foreach ( keys %$h ) {
$self->localConfig->{$_} = $h->{$_};
weaken( $self->localConfig->{$_} ) if ref $self->localConfig->{$_};
$self->localConfig( {
%{ Lemonldap::NG::Common::Conf->new( $args->{configStorage} )
->getLocalConf('portal')
},
%$args
}
}
$self->localConfig->{$_} = $args->{$_} foreach ( keys %$args );
);
# Load override messages from lemonldap-ng.ini
foreach my $k ( keys %{ $self->localConfig } ) {
@ -198,10 +194,7 @@ sub reloadConf {
$self->setPortalRoutes;
# Reinitialize $self->conf
foreach ( keys %{ $self->localConfig } ) {
$self->{conf}->{$_} = $self->localConfig->{$_};
weaken( $self->{conf}->{$_} ) if ref $self->{conf}->{$_};
}
%{ $self->{conf} } = %{ $self->localConfig };
# Reinitialize arrays
foreach ( qw(_macros _groups), @entryPoints ) {