comparison public_html/cgi-bin/_config.pm @ 0:aac1085b256d

initial commit
author cin
date Sat, 15 Mar 2014 00:34:33 +0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:aac1085b256d
1 use strict;
2 use warnings;
3
4 use File::Spec;
5 use Carp;
6
7 my @dirs;
8
9 BEGIN {
10 $Carp::Verbose = 0; # set this to 1 to enable carp traces
11 my $cwd = (File::Spec->splitpath($ENV{SCRIPT_FILENAME} || $0))[1];
12 @dirs = File::Spec->splitdir($cwd);
13
14 #go two dirs up
15 pop @dirs unless pop @dirs; # remove empty dir in case of trailing /
16 pop @dirs;
17
18 push @INC, File::Spec->catdir(@dirs,'lib');
19
20 package IMPL::Config;
21
22 our $AppBase = File::Spec->catdir(@dirs);
23 our $ConfigBase = File::Spec->catdir(@dirs,'config');
24
25 package IMPL::Web::Application::ControllerUnit;
26
27 our @schemaInc;
28
29 push @schemaInc, File::Spec->catdir(@dirs,'schema');
30
31 package main;
32
33 my $bootstrap = File::Spec->catfile($ConfigBase, 'bootstrap.pm');
34 if( -f $bootstrap ) {
35 do $bootstrap;
36
37 ($! ? die($@,$!) : die($@) )if $@;
38
39 }
40
41 }
42
43 1;