[interchange] * Add new Vend::InDev to allow bifurcated interchange.cfg, useful for

Mike Heins interchange-cvs at icdevgroup.org
Thu Jun 16 15:50:41 UTC 2016


commit d8624047dd2980a963e45d5b2bf87ca8f44438aa
Author: Mike Heins <mike at perusion.com>
Date:   Thu Jun 16 11:49:55 2016 -0400

    * Add new Vend::InDev to allow bifurcated interchange.cfg, useful for
      maintaining both a live and dev version with an SCCS system like git.

 WHATSNEW-5.11             |    5 +++++
 dist/interchange.cfg.dist |   12 ++++++++++--
 lib/Vend/InDev.pm         |   15 +++++++++++++++
 3 files changed, 30 insertions(+), 2 deletions(-)
---
diff --git a/WHATSNEW-5.11 b/WHATSNEW-5.11
index df4565a..014ceb1 100644
--- a/WHATSNEW-5.11
+++ b/WHATSNEW-5.11
@@ -30,3 +30,8 @@ Database
   they are defined) means Vend::Dispatch::dispatch() will 
   return that status. This allows features like QueryCache
   and others that are hooked via Preload or Autoload.
+
+* Add skeleton module Vend::InDev, which does nothing but set a single
+  global variable if the file _indev is present in $Global::VendRoot.
+  This allows interchange.cfg bifurcation, useful when maintain a
+  SCCS repository.
diff --git a/dist/interchange.cfg.dist b/dist/interchange.cfg.dist
index ca68577..3851579 100644
--- a/dist/interchange.cfg.dist
+++ b/dist/interchange.cfg.dist
@@ -3,6 +3,11 @@
 # interchange.cfg
 
 #========================================================================#
+#
+
+# Allows use of "ifdef @INDEV" below. Will set INDEV to 1 if file
+# _indev is present.
+Require module Vend::InDev
 
 # These settings all affect other configuration directives below.
 
@@ -28,8 +33,11 @@ Variable  TRAFFIC  low
 
 # Require an external module
 
-# This one tests the realtime payment gateway code, uncomment to test.
-## Require module Vend::Payment::TestPayment
+# This one tests the realtime payment gateway code, set INDEV variable to test.
+#
+ifdef @INDEV
+Require module Vend::Payment::TestPayment
+endif
 
 #========================================================================#
 
diff --git a/lib/Vend/InDev.pm b/lib/Vend/InDev.pm
new file mode 100644
index 0000000..8aedd4c
--- /dev/null
+++ b/lib/Vend/InDev.pm
@@ -0,0 +1,15 @@
+#!/usr/local/bin/perl
+
+## This module just needs to be included once, and early.
+## 
+## Can use:
+## 
+##   Require module Vend::InDev
+##
+##
+#
+package Vend::InDev;
+
+-f '_indev' and $Global::Variable->{INDEV} = 1;
+
+1;



More information about the interchange-cvs mailing list