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