source: trunk/npemap.org.uk/perllib/NPEMap/Config.pm @ 635

Last change on this file since 635 was 635, checked in by Dominic Hargreaves, 13 years ago

licence tastic

File size: 1.6 KB
Line 
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#
20package NPEMap::Config;
21
22use vars qw(@ISA @EXPORT $tt_config $rootdir);
23use warnings;
24use strict;
25
26use FindBin;
27
28require Exporter;
29@ISA    = qw(Exporter);
30@EXPORT = qw($tt_config $dbname $dbhost $dbuser $dbpass $staticdir $tiledir);
31
32# Read in site config
33my $config;
34my @searches = qw( . .. ../.. );
35foreach my $s (@searches) {
36        $config = $FindBin::Bin . "/$s/npemap.conf";
37        if(-f $config) { last; }
38}
39do $config or die "Can't read $config!\n";
40
41$tt_config = {
42    INCLUDE_PATH => $rootdir . '/templates',
43    EVAL_PERL    => 0,
44};
45
461;
Note: See TracBrowser for help on using the repository browser.