[interchange] Automatically create the $Vend::Cfg hash when Vend::External loaded

Josh Lavin interchange-cvs at icdevgroup.org
Fri Sep 2 15:59:22 UTC 2016


commit 8c942fb90a802e252fe29433e28f5b01c32ea859
Author: Josh Lavin <digory at cpan.com>
Date:   Fri Sep 2 08:58:15 2016 -0700

    Automatically create the $Vend::Cfg hash when Vend::External loaded
    
    This prevents the need to call `session()` from scripts, when testing
    your Interchange instance from the command line.

 lib/Vend/External.pm |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/lib/Vend/External.pm b/lib/Vend/External.pm
index 1a1dd99..eaf1b84 100644
--- a/lib/Vend/External.pm
+++ b/lib/Vend/External.pm
@@ -209,6 +209,11 @@ BEGIN {
 			or die "eval_file failed (value=$Vend::Global): $!";
 #::logDebug("DID read global");
 		#logDebug(uneval($Vend::Global));
+
+        $Vend::Cat ||= $ENV{EXT_INTERCHANGE_CATALOG}
+            or die "No Interchange catalog specified\n";
+        $Vend::Cfg = $Vend::Global->{Catalogs}{$Vend::Cat}{external_config}
+            or die "Catalog $Vend::Cat not found.\n";
 	}
 }
 



More information about the interchange-cvs mailing list