From 0340bbe3f45efc7376212acbea8a38500b45d395 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 7 Nov 2013 12:07:34 +0000 Subject: [PATCH] Bug 9316: Add ability to install/configure nginx - Followup Added ability to run plack without Plack::Middleware::Debug installed --- misc/bin/koha.psgi | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/misc/bin/koha.psgi b/misc/bin/koha.psgi index 010907a..170b226 100755 --- a/misc/bin/koha.psgi +++ b/misc/bin/koha.psgi @@ -27,24 +27,35 @@ my $use_list = { }; -if(can_load( modules => { Plack::Middleware::Debug => undef} ) && $ENV{KOHA_DEBUG}){ - my $panels = Plack::Middleware::Debug->default_panels; -} - C4::Context->disable_syspref_cache(); my $intra=Plack::App::CGIBin->new(root => "__INTRANET_CGI_DIR__" ); my $opac = Plack::App::CGIBin->new(root => "__OPAC_CGI_DIR__"); -builder { - enable_if{ - $ENV{KOHA_DEBUG} - } 'Debug', panels => [[ 'DBITrace', level => 1 ], @$panels ]; - enable "Plack::Middleware::Static"; +if(can_load( modules => { Plack::Middleware::Debug => undef} ) && $ENV{KOHA_DEBUG}){ + + my $panels = Plack::Middleware::Debug->default_panels; - enable 'StackTrace'; + builder { + enable 'Debug', panels => [[ 'DBITrace', level => 1 ], @$panels ]; - mount '/cgi-bin/koha/' => $intra; - mount '/cgi-bin/koha/' => $opac; -}; + enable "Plack::Middleware::Static"; + + enable 'StackTrace'; + + mount '/cgi-bin/koha/' => $intra; + mount '/cgi-bin/koha/' => $opac; + }; +} + +else { + builder { + enable "Plack::Middleware::Static"; + + enable 'StackTrace'; + + mount '/cgi-bin/koha/' => $intra + mount '/cgi-bin/koha/' => $opac; + }; +} -- 1.7.10.4