Skip to content

Commit

Permalink
* Add new Vend::InDev to allow bifurcated interchange.cfg, useful for
Browse files Browse the repository at this point in the history
  maintaining both a live and dev version with an SCCS system like git.
  • Loading branch information
perusionmike committed Jun 16, 2016
1 parent 0dff68d commit d862404
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
5 changes: 5 additions & 0 deletions WHATSNEW-5.11
Expand Up @@ -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.
12 changes: 10 additions & 2 deletions dist/interchange.cfg.dist
Expand Up @@ -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.

Expand All @@ -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

#========================================================================#

Expand Down
15 changes: 15 additions & 0 deletions 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;

0 comments on commit d862404

Please sign in to comment.