From 3dff3f065e97d1c23be836b4a26eb678fa69dd80 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 18 Jun 2008 00:27:44 +0000 Subject: [PATCH] fix dependency loop problem with database config, hopefully? (Record->Msgcat->Conf->Record) --- FS/FS/Msgcat.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/FS/FS/Msgcat.pm b/FS/FS/Msgcat.pm index 625743dc0..771615727 100644 --- a/FS/FS/Msgcat.pm +++ b/FS/FS/Msgcat.pm @@ -6,17 +6,19 @@ use Exporter; use FS::UID; #use FS::Record qw( qsearchs ); # wtf? won't import... use FS::Record; -use FS::Conf; +#use FS::Conf; #wtf? causes dependency loops too. use FS::msgcat; @ISA = qw(Exporter); @EXPORT_OK = qw( gettext geterror ); -$FS::UID::callback{'Msgcat'} = sub { +FS::UID->install_callback( sub { + eval { use FS::Conf; }; + die $@ if $@; $conf = new FS::Conf; $locale = $conf->config('locale') || 'en_US'; $debug = $conf->exists('show-msgcat-codes') -}; +}); =head1 NAME -- 2.11.0