annotate public_html/cgi-bin/_config.pm @ 2:a7a3e4f626ff

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