[interchange-cvs] interchange - heins modified lib/Vend/Config.pm

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Sun May 8 23:19:13 EDT 2005


User:      heins
Date:      2005-05-09 03:19:12 GMT
Modified:  lib/Vend Config.pm
Log:
* Add ability to alias a directive in a configuration file. I just
  made it a fixed one at this point, though we could add a "DirectiveAlias"
  directive if we want. 8-)

* It always seemed a bit stupid to have ProductDir and ProductsFile
  in a non-commerce catalog. Now you can do instead

  	  DataDir   			data
	  DefaultDataTables     wiki rss

  should you want.

Revision  Changes    Path
2.173     +16 -2     interchange/lib/Vend/Config.pm


rev 2.173, prev_rev 2.172
Index: Config.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Config.pm,v
retrieving revision 2.172
retrieving revision 2.173
diff -u -r2.172 -r2.173
--- Config.pm	8 May 2005 14:51:07 -0000	2.172
+++ Config.pm	9 May 2005 03:19:12 -0000	2.173
@@ -1,6 +1,6 @@
 # Vend::Config - Configure Interchange
 #
-# $Id: Config.pm,v 2.172 2005/05/08 14:51:07 mheins Exp $
+# $Id: Config.pm,v 2.173 2005/05/09 03:19:12 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -51,7 +51,7 @@
 use Vend::File;
 use Vend::Data;
 
-$VERSION = substr(q$Revision: 2.172 $, 10);
+$VERSION = substr(q$Revision: 2.173 $, 10);
 
 my %CDname;
 my %CPname;
@@ -78,6 +78,11 @@
 	},
 );
 
+my %DirectiveAlias = qw(
+	DataDir        ProductDir
+	DefaultTables  ProductFiles 
+);
+
 for( qw(search refresh cancel return secure unsecure submit control checkout) ) {
 	$Global::LegalAction{$_} = 1;
 }
@@ -974,6 +979,15 @@
 			$CPname{$directive} = $d->[1];
 			$parse{$directive} = get_parse_routine($d->[1]);
 		}
+	}
+
+	for(keys %DirectiveAlias) {
+		my $k = lc $_;
+		my $v = $DirectiveAlias{$_};
+		my $lv = lc $v;
+		$CDname{$k} = $CDname{$lv};
+		$CPname{$k} = $CPname{$lv};
+		$parse{$k} = $parse{$lv};
 	}
 
 	no strict 'refs';








More information about the interchange-cvs mailing list