From: Chris W. <la...@us...> - 2004-11-09 11:37:16
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12740 Modified Files: Initializer.pm Log Message: ensure the config watcher class is included before we add it as an observer Index: Initializer.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Config/Initializer.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Initializer.pm 27 Sep 2004 03:35:14 -0000 1.18 --- Initializer.pm 9 Nov 2004 11:37:08 -0000 1.19 *************** *** 9,12 **** --- 9,13 ---- use OpenInteract2::Constants qw( :log ); use OpenInteract2::Context qw( CTX ); + use OpenInteract2::Exception qw( oi_error ); use OpenInteract2::URL; *************** *** 41,50 **** my $config_watcher = $config->config_watcher; next unless ( $config_watcher ); ! push @conf_watchers, @{ $config_watcher }; } foreach my $watcher_class ( @conf_watchers ) { __PACKAGE__->add_observer( $watcher_class ); ! $log->info( "Adding custom config observer [$watcher_class]" ); } --- 42,59 ---- my $config_watcher = $config->config_watcher; next unless ( $config_watcher ); ! foreach my $watcher_class ( @{ $config_watcher } ) { ! eval "require $watcher_class"; ! if ( $@ ) { ! oi_error "Cannot find configured watcher '$watcher_class' ", ! "from package '", $package->name, "': $@"; ! } ! $log->info( "Required watcher '$watcher_class' ok" ); ! push @conf_watchers, $watcher_class; ! } } foreach my $watcher_class ( @conf_watchers ) { __PACKAGE__->add_observer( $watcher_class ); ! $log->info( "Added custom config observer '$watcher_class'" ); } |