1 | # Copyright (c) 2006 Dominic Hargreaves |
---|
2 | # Permission is hereby granted, free of charge, to any person obtaining a |
---|
3 | # copy of this software and associated documentation files (the "Software"), |
---|
4 | # to deal in the Software without restriction, including without limitation |
---|
5 | # the rights to use, copy, modify, merge, publish, distribute, sublicense, |
---|
6 | # and/or sell copies of the Software, and to permit persons to whom the |
---|
7 | # Software is furnished to do so, subject to the following conditions: |
---|
8 | # |
---|
9 | # The above copyright notice and this permission notice shall be included in |
---|
10 | # all copies or substantial portions of the Software. |
---|
11 | # |
---|
12 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
---|
13 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
---|
14 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
---|
15 | # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
---|
16 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
---|
17 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
---|
18 | # IN THE SOFTWARE. |
---|
19 | # |
---|
20 | package NPEMap::Config; |
---|
21 | |
---|
22 | use vars qw(@ISA @EXPORT $tt_config $rootdir); |
---|
23 | use warnings; |
---|
24 | use strict; |
---|
25 | |
---|
26 | use FindBin; |
---|
27 | |
---|
28 | require Exporter; |
---|
29 | @ISA = qw(Exporter); |
---|
30 | @EXPORT = qw($tt_config $dbname $dbhost $dbuser $dbpass $staticdir $tiledir); |
---|
31 | |
---|
32 | # Read in site config |
---|
33 | my $config; |
---|
34 | my @searches = qw( . .. ../.. ); |
---|
35 | foreach my $s (@searches) { |
---|
36 | $config = $FindBin::Bin . "/$s/npemap.conf"; |
---|
37 | if(-f $config) { last; } |
---|
38 | } |
---|
39 | do $config or die "Can't read $config!\n"; |
---|
40 | |
---|
41 | $tt_config = { |
---|
42 | INCLUDE_PATH => $rootdir . '/templates', |
---|
43 | EVAL_PERL => 0, |
---|
44 | }; |
---|
45 | |
---|
46 | 1; |
---|