Skip to content

Commit

Permalink
* Add CounterDir configuration to allow counters to be defined
Browse files Browse the repository at this point in the history
  by default in someplace different than VendRoot.

  Example:

     CounterDir   var/counters

  Note: You can make this work with existing Interchange catalogs that
  have counters in etc/ and logs/ if you do this script:

  	cd <vendroot>
  	mkdir var/counters
	mv -f etc/*.number var/counters
	mv -f etc/*.counter var/counters
	mv -f log/*.number var/counters
	mv -f log/*.counter var/counters
	cd var/counters
	ln -s . etc
	ln -s . logs

  TODO: Should we auto-create directories?

* Remove StaticDir directive, it's been ten years since this was
  needed. No longer referenced in any catalog template.
  • Loading branch information
Mike Heins committed Feb 2, 2017
1 parent 2ec6dfa commit 8397531
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Vend/Config.pm
Expand Up @@ -681,7 +681,7 @@ sub catalog_directives {
['TrackDateFormat', undef, ''],
['SalesTax', undef, ''],
['SalesTaxFunction', undef, ''],
['StaticDir', undef, ''],
['CounterDir', 'relative_dir', ''],
['SOAP', 'yesno', 'No'],
['SOAP_Enable', 'hash', ''],
['SOAP_Action', 'action', ''],
Expand Down
2 changes: 1 addition & 1 deletion lib/Vend/Interpolate.pm
Expand Up @@ -2245,7 +2245,7 @@ sub tag_counter {
return undef;
}

$file = $Vend::Cfg->{VendRoot} . "/$file"
$file = ($Vend::Cfg->{CounterDir} || $Vend::Cfg->{VendRoot}) . "/$file"
unless Vend::Util::file_name_is_absolute($file);

for(qw/inc_routine dec_routine/) {
Expand Down

0 comments on commit 8397531

Please sign in to comment.