From: Aaron Trevena Date: Mon, 11 Jul 2005 09:56:04 +0000 (+0000) Subject: update to BeerDB.pm to use env var for DSN details if provided X-Git-Tag: 2.10~11 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=88159aa11999cc57eb6ad0d6d4620bac638329d1;p=maypole.git update to BeerDB.pm to use env var for DSN details if provided git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@353 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/META.yml b/META.yml index 0723255..022d222 100644 --- a/META.yml +++ b/META.yml @@ -1,7 +1,7 @@ # http://module-build.sourceforge.net/META-spec.html #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: Maypole -version: 2.10_pre2 +version: 2.10_pre2a version_from: lib/Maypole.pm installdirs: site requires: diff --git a/ex/BeerDB.pm b/ex/BeerDB.pm index 6d90b2e..1e4291a 100644 --- a/ex/BeerDB.pm +++ b/ex/BeerDB.pm @@ -6,7 +6,7 @@ sub debug { $ENV{BEERDB_DEBUG} } # This is the sample application. Change this to the path to your # database. (or use mysql or something) use constant DBI_DRIVER => 'SQLite'; -use constant DATASOURCE => 't/beerdb.db'; +use constant DATASOURCE => $ENV{BEERDB_DATASOURCE} || 't/beerdb.db'; BEGIN { my $dbi_driver = DBI_DRIVER;