Line 0
Link Here
|
0 |
- |
1 |
#!/usr/bin/perl |
|
|
2 |
use Plack::Builder; |
3 |
use Plack::App::CGIBin; |
4 |
use Plack::Middleware::Debug; |
5 |
use Plack::App::Directory; |
6 |
|
7 |
# cpanm Plack::Middleware::Debug::DBIProfile |
8 |
|
9 |
use C4::Context; |
10 |
use C4::Languages; |
11 |
use C4::Members; |
12 |
use C4::Dates; |
13 |
use C4::Boolean; |
14 |
use C4::Letters; |
15 |
use C4::Koha; |
16 |
use C4::XSLT; |
17 |
use C4::Branch; |
18 |
use C4::Category; |
19 |
|
20 |
my $app=Plack::App::CGIBin->new(root => $ENV{INTRANETDIR}); |
21 |
|
22 |
builder { |
23 |
|
24 |
enable_if { $ENV{PLACK_DEBUG} } 'Debug', panels => [ |
25 |
qw(Environment Response Timer Memory), |
26 |
# [ 'Profiler::NYTProf', exclude => [qw(.*\.css .*\.png .*\.ico .*\.js .*\.gif)] ], |
27 |
# [ 'DBITrace', level => 1 ], # a LOT of fine-graded SQL trace |
28 |
[ 'DBIProfile', profile => 2 ], |
29 |
]; |
30 |
|
31 |
enable_if { $ENV{PLACK_DEBUG} } 'StackTrace'; |
32 |
|
33 |
enable "Plack::Middleware::Static", |
34 |
path => qr{^/intranet-tmpl/}, root => '/srv/koha/koha-tmpl/'; |
35 |
|
36 |
enable_if { $ENV{PLACK_MINIFIER} } "Plack::Middleware::Static::Minifier", |
37 |
path => qr{^/intranet-tmpl/}, |
38 |
root => './koha-tmpl/'; |
39 |
|
40 |
|
41 |
mount "/cgi-bin/koha" => $app; |
42 |
|
43 |
}; |
44 |
|